mirror of
https://github.com/tim-beatham/smegmesh.git
synced 2024-12-12 17:41:08 +01:00
17 lines
340 B
Go
17 lines
340 B
Go
package mesh
|
|
|
|
import (
|
|
"github.com/tim-beatham/wgmesh/pkg/conf"
|
|
"github.com/tim-beatham/wgmesh/pkg/lib"
|
|
)
|
|
|
|
func pruneFunction(m MeshManager) lib.TimerFunc {
|
|
return func() error {
|
|
return m.Prune()
|
|
}
|
|
}
|
|
|
|
func NewPruner(m MeshManager, conf conf.WgMeshConfiguration) *lib.Timer {
|
|
return lib.NewTimer(pruneFunction(m), conf.PruneTime/2)
|
|
}
|