2
0
Эх сурвалжийг харах

Log when server was started to websocket /monitor interface

Ask Bjørn Hansen 12 жил өмнө
parent
commit
4afac63023
1 өөрчлөгдсөн 2 нэмэгдсэн , 0 устгасан
  1. 2 0
      monitor.go

+ 2 - 0
monitor.go

@@ -111,6 +111,8 @@ func initialStatus() string {
 	hostname, err := os.Hostname()
 	if err == nil {
 		status["h"] = hostname
+		status["up"] = strconv.Itoa(int(time.Since(timeStarted).Seconds()))
+		status["started"] = strconv.Itoa(int(timeStarted.Unix()))
 	}
 	message, err := json.Marshal(status)
 	return string(message)