mirror of
https://github.com/bingohuang/docker-labs.git
synced 2025-07-14 10:17:26 +08:00
* Once every second the session run a list of periodic tasks on every instance concurrently. We use these tasks to do things like: - Collect mem and cpu stats - Check if instance is part of a swarm cluster - Broadcast information to connected clients
12 lines
226 B
Go
12 lines
226 B
Go
package services
|
|
|
|
type periodicTask interface {
|
|
Run(i *Instance)
|
|
}
|
|
|
|
var periodicTasks []periodicTask
|
|
|
|
func init() {
|
|
periodicTasks = append(periodicTasks, &collectStatsTask{}, &checkSwarmStatusTask{}, &broadcastInfoTask{})
|
|
}
|