summaryrefslogtreecommitdiff
path: root/event.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-10-13 02:23:30 -0500
committerJeff Carr <[email protected]>2024-10-13 02:23:30 -0500
commitca1a78394fe2fe7d556153819dd5f20e3d65920a (patch)
tree676168a2e3cc55f67c0fc7091dae3e0c1377a8d6 /event.go
parent268cec143ae544d8b6abed55b2f84570b51ea030 (diff)
attempt to generate an event. next up: protobuf
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'event.go')
-rw-r--r--event.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/event.go b/event.go
index ec47c6e..d554c78 100644
--- a/event.go
+++ b/event.go
@@ -1,6 +1,8 @@
package main
import (
+ "time"
+
"go.wit.com/lib/gui/shell"
"go.wit.com/log"
)
@@ -13,4 +15,9 @@ func (h *HyperT) RestartDaemon() {
url := "http://" + h.Hostname + ":2520/kill"
s := shell.Wget(url)
log.Info("EVENT RestartDaemon", url, s)
+ h.lastpoll = time.Now()
+ h.killcount += 1
+
+ dur := time.Since(h.lastpoll) // Calculate the elapsed time
+ log.Info("KILLED DAEMON", h.Hostname, shell.FormatDuration(dur), "curl", url)
}