Browse Source

fixing timer logic

afeiszli 3 years ago
parent
commit
8694295dc4
2 changed files with 4 additions and 3 deletions
  1. 1 1
      logic/telemetry.go
  2. 3 2
      logic/timer.go

+ 1 - 1
logic/telemetry.go

@@ -95,7 +95,7 @@ func getClientCount(nodes []models.Node) clientCount {
 	var count clientCount
 	for _, node := range nodes {
 		switch node.OS {
-		case "macos":
+		case "darwin":
 			count.MacOS += 1
 		case "windows":
 			count.Windows += 1

+ 3 - 2
logic/timer.go

@@ -29,9 +29,10 @@ func TimerCheckpoint() error {
 	if enoughTimeElapsed {
 		// run any time hooks
 		runHooks()
+		return setTelemetryTimestamp(&telRecord)
+
 	}
-	// set telemetry timestamp for server, restarts 24 hour cycle
-	return setTelemetryTimestamp(&telRecord)
+	return nil
 }
 
 // AddHook - adds a hook function to run every 24hrs