Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update handleRollback to support both PeriodicFunc and handleWALRollback #6717

Merged
merged 1 commit into from
May 10, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions sdk/framework/backend.go
Original file line number Diff line number Diff line change
@@ -418,16 +418,22 @@ func (b *Backend) handleRevokeRenew(ctx context.Context, req *logical.Request) (
}
}

// handleRollback invokes the PeriodicFunc set on the backend. It also does a WAL rollback operation.
// handleRollback invokes the PeriodicFunc set on the backend. It also does a
// WAL rollback operation.
func (b *Backend) handleRollback(ctx context.Context, req *logical.Request) (*logical.Response, error) {
// Response is not expected from the periodic operation.
var merr error
if b.PeriodicFunc != nil {
if err := b.PeriodicFunc(ctx, req); err != nil {
return nil, err
merr = multierror.Append(merr, err)
}
}

return b.handleWALRollback(ctx, req)
resp, err := b.handleWALRollback(ctx, req)
if err != nil {
merr = multierror.Append(merr, err)
}
return resp, merr
}

func (b *Backend) handleAuthRenew(ctx context.Context, req *logical.Request) (*logical.Response, error) {