mirror of
https://github.com/tim-beatham/smegmesh.git
synced 2024-12-13 10:01:22 +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.
19 lines
432 B
Go
19 lines
432 B
Go
package sync
|
|
|
|
import (
|
|
"github.com/tim-beatham/wgmesh/pkg/ctrlserver"
|
|
"github.com/tim-beatham/wgmesh/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.SyncRate)
|
|
}
|