Execute first and sleep, not the other way
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
cf671ff332
commit
707235115c
|
@ -26,8 +26,6 @@ import (
|
||||||
// UpdateActiveClients counts all clients and sends the number to the server. Meant to run inside a goroutine.
|
// UpdateActiveClients counts all clients and sends the number to the server. Meant to run inside a goroutine.
|
||||||
func UpdateActiveClients() {
|
func UpdateActiveClients() {
|
||||||
for {
|
for {
|
||||||
time.Sleep(config.UpdateSecondsInterval * time.Second)
|
|
||||||
|
|
||||||
clients := ParseCSVDumps(viper.GetString("daemon.csvlocation"))
|
clients := ParseCSVDumps(viper.GetString("daemon.csvlocation"))
|
||||||
|
|
||||||
var activeClients int64
|
var activeClients int64
|
||||||
|
@ -40,5 +38,7 @@ func UpdateActiveClients() {
|
||||||
ActiveClients <- activeClients
|
ActiveClients <- activeClients
|
||||||
//fmt.Println("Active Clients:", activeClients)
|
//fmt.Println("Active Clients:", activeClients)
|
||||||
//fmt.Println("Total Clients:", len(clients))
|
//fmt.Println("Total Clients:", len(clients))
|
||||||
|
|
||||||
|
time.Sleep(config.UpdateSecondsInterval * time.Second)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue