mirror of
https://github.com/ddworken/hishtory.git
synced 2024-11-25 01:33:28 +01:00
Promote the background updates of the DB from BetaMode to prod
This commit is contained in:
parent
08e734a1fe
commit
6bb12241c9
@ -76,12 +76,19 @@ var updateLocalDbFromRemoteCmd = &cobra.Command{
|
||||
if config.IsOffline {
|
||||
return
|
||||
}
|
||||
// TODO: Move this out of config.BetaMode only once we're confident in this change
|
||||
if config.BetaMode {
|
||||
// Do it a random percent of the time, which should be approximately often enough.
|
||||
if rand.Intn(20) == 0 && !config.IsOffline {
|
||||
lib.CheckFatalError(lib.RetrieveAdditionalEntriesFromRemote(ctx, "preload"))
|
||||
lib.CheckFatalError(lib.ProcessDeletionRequests(ctx))
|
||||
err := lib.RetrieveAdditionalEntriesFromRemote(ctx, "preload")
|
||||
if config.BetaMode {
|
||||
lib.CheckFatalError(err)
|
||||
} else if err != nil {
|
||||
hctx.GetLogger().Infof("updateLocalDbFromRemote: Failed to RetrieveAdditionalEntriesFromRemote: %v", err)
|
||||
}
|
||||
err = lib.ProcessDeletionRequests(ctx)
|
||||
if config.BetaMode {
|
||||
lib.CheckFatalError(err)
|
||||
} else if err != nil {
|
||||
hctx.GetLogger().Infof("updateLocalDbFromRemote: Failed to ProcessDeletionRequests: %v", err)
|
||||
}
|
||||
}
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user