Files
Self-Service-Dashboard/src/main/worker.go
Gregory Wells d4512e9cce Debug worker
2026-03-24 18:38:47 -04:00

20 lines
335 B
Go

package main
import (
"time"
"astraltech.xyz/accountmanager/src/logging"
)
func createWorker(interval time.Duration, task func()) {
logging.Debugf("Creating worker that runs on a %s interval", interval.String())
go func() {
ticker := time.NewTicker(interval)
defer ticker.Stop()
for range ticker.C {
task()
}
}()
}