From 6bb12241c9a8288477e0d0432b72b25c0dbb6e6f Mon Sep 17 00:00:00 2001 From: David Dworken Date: Sat, 21 Oct 2023 09:47:20 -0700 Subject: [PATCH] Promote the background updates of the DB from BetaMode to prod --- client/cmd/query.go | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/client/cmd/query.go b/client/cmd/query.go index cf10744..d4b0bbb 100644 --- a/client/cmd/query.go +++ b/client/cmd/query.go @@ -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)) + // Do it a random percent of the time, which should be approximately often enough. + if rand.Intn(20) == 0 && !config.IsOffline { + 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) } } },