From e3ea97c964300a290179c835084d308e7866d160 Mon Sep 17 00:00:00 2001 From: jiuker <2818723467@qq.com> Date: Sun, 20 Aug 2023 13:09:07 +0800 Subject: [PATCH] fix: replace req context by locker context (#17880) --- cmd/admin-handlers.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmd/admin-handlers.go b/cmd/admin-handlers.go index eee5ab6b1..812ffefcb 100644 --- a/cmd/admin-handlers.go +++ b/cmd/admin-handlers.go @@ -1147,6 +1147,7 @@ func (a adminAPIHandlers) SitePerfHandler(w http.ResponseWriter, r *http.Request writeErrorResponseJSON(ctx, w, errorCodes.ToAPIErr(toAPIErrorCode(ctx, err)), r.URL) return } + ctx = lkctx.Context() defer nsLock.Unlock(lkctx) durationStr := r.Form.Get(peerRESTDuration) @@ -1253,6 +1254,7 @@ func (a adminAPIHandlers) NetperfHandler(w http.ResponseWriter, r *http.Request) writeErrorResponseJSON(ctx, w, errorCodes.ToAPIErr(toAPIErrorCode(ctx, err)), r.URL) return } + ctx = lkctx.Context() defer nsLock.Unlock(lkctx) durationStr := r.Form.Get(peerRESTDuration)