diff --git a/certificate/authorization/endpoint.go b/certificate/authorization/endpoint.go index 648d75c17..a455ed801 100644 --- a/certificate/authorization/endpoint.go +++ b/certificate/authorization/endpoint.go @@ -78,7 +78,7 @@ func (endpoint *Endpoint) Close() error { func (endpoint *Endpoint) handleAuthorization(writer http.ResponseWriter, httpReq *http.Request) { var err error ctx := httpReq.Context() - mon.Task()(&ctx)(&err) + defer mon.Task()(&ctx)(&err) if httpReq.Method != http.MethodPut { msg := fmt.Sprintf("unsupported HTTP method: %s", httpReq.Method) diff --git a/satellite/overlay/service.go b/satellite/overlay/service.go index 04afbd9ea..6e97f6ac4 100644 --- a/satellite/overlay/service.go +++ b/satellite/overlay/service.go @@ -460,7 +460,7 @@ func (service *Service) Reliable(ctx context.Context) (nodes storj.NodeIDList, e // UpdateReputation updates the DB columns for any of the reputation fields. func (service *Service) UpdateReputation(ctx context.Context, id storj.NodeID, request *ReputationStatus) (err error) { - mon.Task()(&ctx)(&err) + defer mon.Task()(&ctx)(&err) return service.db.UpdateReputation(ctx, id, request) } diff --git a/satellite/satellitedb/overlaycache.go b/satellite/satellitedb/overlaycache.go index 8fb32a87d..9a3593c4f 100644 --- a/satellite/satellitedb/overlaycache.go +++ b/satellite/satellitedb/overlaycache.go @@ -496,7 +496,7 @@ func (cache *overlaycache) reliable(ctx context.Context, criteria *overlay.NodeC // UpdateReputation updates the DB columns for any of the reputation fields in UpdateReputationRequest. func (cache *overlaycache) UpdateReputation(ctx context.Context, id storj.NodeID, request *overlay.ReputationStatus) (err error) { - mon.Task()(&ctx)(&err) + defer mon.Task()(&ctx)(&err) err = cache.db.WithTx(ctx, func(ctx context.Context, tx *dbx.Tx) (err error) { _, err = tx.Tx.ExecContext(ctx, "SET TRANSACTION ISOLATION LEVEL SERIALIZABLE")