Address feedback

This commit is contained in:
Abhishek Pandey 2023-11-14 17:39:06 -08:00
parent 5bab966f67
commit 3b6d4bfe8b

View File

@ -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