Promote the background updates of the DB from BetaMode to prod

This commit is contained in:
David Dworken 2023-10-21 09:47:20 -07:00
parent 08e734a1fe
commit 6bb12241c9
No known key found for this signature in database

View File

@ -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)
} }
} }
}, },