From 3b6d4bfe8bb2692cf43fd66e5f63bf7a91cee136 Mon Sep 17 00:00:00 2001 From: Abhishek Pandey Date: Tue, 14 Nov 2023 17:39:06 -0800 Subject: [PATCH] Address feedback --- src/internal/operations/backup.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/internal/operations/backup.go b/src/internal/operations/backup.go index c369a447f..1821e2e3c 100644 --- a/src/internal/operations/backup.go +++ b/src/internal/operations/backup.go @@ -205,6 +205,13 @@ func (op *BackupOperation) Run(ctx context.Context) (err error) { ctx, flushMetrics := events.NewMetrics(ctx, logger.Writer{Ctx: ctx}) defer flushMetrics() + // Select an appropriate rate limiter for the service. + ctx = graph.BindRateLimiterConfig( + ctx, + graph.LimiterCfg{ + Service: op.Selectors.PathService(), + }) + // Check if the protected resource has the service enabled in order for us // to run a backup. enabled, err := op.bp.IsServiceEnabled( @@ -424,13 +431,6 @@ func (op *BackupOperation) do( lastBackupVersion = mans.MinBackupVersion() } - // Select an appropriate rate limiter for the service. - ctx = graph.BindRateLimiterConfig( - ctx, - graph.LimiterCfg{ - Service: op.Selectors.PathService(), - }) - // TODO(ashmrtn): This should probably just return a collection that deletes // the entire subtree instead of returning an additional bool. That way base // selection is controlled completely by flags and merging is controlled