Files
mostlymatter/vendor/github.com/splitio/go-split-commons/v3/tasks/splitsync.go
Joram Wilander aba00a3cfd Update split SDK to 6.0.2 to fix sync bug (#17060)
* Update split SDK to 6.0.2 to fix sync bug

* Vendor and tidy
2021-03-04 11:16:08 -05:00

22 строки
580 B
Go

package tasks
import (
"github.com/splitio/go-split-commons/v3/synchronizer/worker/split"
"github.com/splitio/go-toolkit/v4/asynctask"
"github.com/splitio/go-toolkit/v4/logging"
)
// NewFetchSplitsTask creates a new splits fetching and storing task
func NewFetchSplitsTask(
fetcher split.Updater,
period int,
logger logging.LoggerInterface,
) *asynctask.AsyncTask {
update := func(logger logging.LoggerInterface) error {
_, err := fetcher.SynchronizeSplits(nil, false)
return err
}
return asynctask.NewAsyncTask("UpdateSplits", update, period, nil, nil, logger)
}