mirror of
https://github.com/tim-beatham/smegmesh.git
synced 2025-01-10 07:18:13 +01:00
fd29af73e3
- Added pull rate to configuration (finally) so this can be modified by an administrator.
16 lines
433 B
Go
16 lines
433 B
Go
package timer
|
|
|
|
import (
|
|
"github.com/tim-beatham/wgmesh/pkg/ctrlserver"
|
|
"github.com/tim-beatham/wgmesh/pkg/lib"
|
|
logging "github.com/tim-beatham/wgmesh/pkg/log"
|
|
)
|
|
|
|
func NewTimestampScheduler(ctrlServer *ctrlserver.MeshCtrlServer) lib.Timer {
|
|
timerFunc := func() error {
|
|
logging.Log.WriteInfof("Updated Timestamp")
|
|
return ctrlServer.MeshManager.UpdateTimeStamp()
|
|
}
|
|
return *lib.NewTimer(timerFunc, ctrlServer.Conf.HeartBeat)
|
|
}
|