forked from extern/smegmesh
dbc18bddc6
- Performing DAD to check if IPv6 address present before adding outselves to mesh - Changing name from wgmesh to smegmesh
19 lines
436 B
Go
19 lines
436 B
Go
package sync
|
|
|
|
import (
|
|
"github.com/tim-beatham/smegmesh/pkg/ctrlserver"
|
|
"github.com/tim-beatham/smegmesh/pkg/lib"
|
|
)
|
|
|
|
// Run implements SyncScheduler.
|
|
func syncFunction(syncer Syncer) lib.TimerFunc {
|
|
return func() error {
|
|
syncer.SyncMeshes()
|
|
return nil
|
|
}
|
|
}
|
|
|
|
func NewSyncScheduler(s *ctrlserver.MeshCtrlServer, syncRequester SyncRequester, syncer Syncer) *lib.Timer {
|
|
return lib.NewTimer(syncFunction(syncer), s.Conf.SyncTime)
|
|
}
|