summaryrefslogtreecommitdiffstats
path: root/server/duty.go
diff options
context:
space:
mode:
authorSam Anthony <sam@samanthony.xyz>2024-11-29 15:17:06 -0500
committerSam Anthony <sam@samanthony.xyz>2024-11-29 15:17:06 -0500
commitcee1d301809ec0b517962816b1b232c22a41eb3b (patch)
tree767c424653b71555919ae81261d0300aefc1faf0 /server/duty.go
parent6c8ae5c3a0d40c34a8db1aa4eac27734c321ca7b (diff)
downloadsoen422-cee1d301809ec0b517962816b1b232c22a41eb3b.zip
server: record duty cycle over time
Diffstat (limited to 'server/duty.go')
-rw-r--r--server/duty.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/server/duty.go b/server/duty.go
index 55022f3..532bfbc 100644
--- a/server/duty.go
+++ b/server/duty.go
@@ -2,7 +2,6 @@ package main
import (
"fmt"
- "github.com/sam-rba/share"
"log"
"net/http"
"strconv"
@@ -16,7 +15,7 @@ const (
type DutyCycle float32
type DutyCycleHandler struct {
- dc share.Val[DutyCycle]
+ dc Record[DutyCycle]
}
func (h DutyCycleHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
@@ -34,7 +33,7 @@ func (h DutyCycleHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
return
}
- h.dc.Set <- DutyCycle(dc)
+ h.dc.put <- DutyCycle(dc)
}
func isValidDutyCycle(dc float64) bool {