mirror of
https://github.com/tim-beatham/smegmesh.git
synced 2024-12-12 17:41:08 +01:00
fe14f63217
- Ability to run a command pre up and post down - Ability to be a client in one mesh and a peer in the other - Added dev card to specify different sync rate, keepalive rate per mesh.
16 lines
437 B
Go
16 lines
437 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.KeepAliveTime)
|
|
}
|