2023-10-24 17:00:46 +02:00
|
|
|
package timestamp
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/tim-beatham/wgmesh/pkg/ctrlserver"
|
2023-11-06 14:37:28 +01:00
|
|
|
"github.com/tim-beatham/wgmesh/pkg/lib"
|
2023-10-24 17:00:46 +02:00
|
|
|
)
|
|
|
|
|
2023-11-06 14:37:28 +01:00
|
|
|
func NewTimestampScheduler(ctrlServer *ctrlserver.MeshCtrlServer) lib.Timer {
|
|
|
|
timerFunc := func() error {
|
|
|
|
return ctrlServer.MeshManager.UpdateTimeStamp()
|
2023-11-05 13:08:20 +01:00
|
|
|
}
|
2023-10-24 17:00:46 +02:00
|
|
|
|
2023-11-06 14:37:28 +01:00
|
|
|
return *lib.NewTimer(timerFunc, ctrlServer.Conf.KeepAliveTime)
|
2023-10-24 17:00:46 +02:00
|
|
|
}
|