* Add feature flag managment system using split.io and remove viper. * Fixing tests. * Attempt to fix postgres tests. * Fix watch filepath for advanced logging. * Review fixes. * Some error wrapping. * Remove unessisary store interface. * Desanitize SplitKey * Simplify. * Review feedback. * Rename split mlog adatper to split logger. * fsInner * Style. * Restore oldcfg test. * Downgrading non-actionable feature flag errors to warnings. Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
21 строка
562 B
Go
21 строка
562 B
Go
package tasks
|
|
|
|
import (
|
|
"github.com/splitio/go-split-commons/v2/synchronizer/worker/split"
|
|
"github.com/splitio/go-toolkit/v3/asynctask"
|
|
"github.com/splitio/go-toolkit/v3/logging"
|
|
)
|
|
|
|
// NewFetchSplitsTask creates a new splits fetching and storing task
|
|
func NewFetchSplitsTask(
|
|
fetcher split.SplitFetcher,
|
|
period int,
|
|
logger logging.LoggerInterface,
|
|
) *asynctask.AsyncTask {
|
|
update := func(logger logging.LoggerInterface) error {
|
|
return fetcher.SynchronizeSplits(nil)
|
|
}
|
|
|
|
return asynctask.NewAsyncTask("UpdateSplits", update, period, nil, nil, logger)
|
|
}
|