mirror of
https://github.com/ddworken/hishtory.git
synced 2024-11-22 00:03:58 +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 {
|
if config.IsOffline {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// TODO: Move this out of config.BetaMode only once we're confident in this change
|
// Do it a random percent of the time, which should be approximately often enough.
|
||||||
if config.BetaMode {
|
if rand.Intn(20) == 0 && !config.IsOffline {
|
||||||
// Do it a random percent of the time, which should be approximately often enough.
|
err := lib.RetrieveAdditionalEntriesFromRemote(ctx, "preload")
|
||||||
if rand.Intn(20) == 0 && !config.IsOffline {
|
if config.BetaMode {
|
||||||
lib.CheckFatalError(lib.RetrieveAdditionalEntriesFromRemote(ctx, "preload"))
|
lib.CheckFatalError(err)
|
||||||
lib.CheckFatalError(lib.ProcessDeletionRequests(ctx))
|
} 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