diff --git a/backend.go b/backend.go index 97ef5a9..770a330 100644 --- a/backend.go +++ b/backend.go @@ -88,7 +88,7 @@ func (b *backblazeB2Backend) reset() { } func (b *backblazeB2Backend) invalidate(_ context.Context, key string) { - if key == "config" { + if key == configStoragePath { b.reset() } } diff --git a/path_config_rotate.go b/path_config_rotate.go index 0646128..132e064 100644 --- a/path_config_rotate.go +++ b/path_config_rotate.go @@ -73,6 +73,8 @@ func (b *backblazeB2Backend) pathConfigRotateRootUpdate(ctx context.Context, req return nil, fmt.Errorf("failed to generate JSON configuration: %w", err) } + b.reset() + // And store it if err := req.Storage.Put(ctx, entry); err != nil { return nil, fmt.Errorf("failed to persist configuration: %w", err)