fix: replace req context by locker context (#17880)

This commit is contained in:
jiuker
2023-08-20 13:09:07 +08:00
committed by GitHub
parent 7219ae530e
commit e3ea97c964

View File

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