Skip to content

Commit ae9c3aa

Browse files
committed
revert defer cancel
1 parent e1cc5d3 commit ae9c3aa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

api/restHandler/DeploymentConfigurationRestHandler.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ func (handler *DeploymentConfigurationRestHandlerImpl) GetConfigData(w http.Resp
103103
//RBAC END
104104
isSuperAdmin := handler.enforcer.Enforce(token, casbin.ResourceGlobal, casbin.ActionGet, "*")
105105
userHasAdminAccess := handler.enforcer.Enforce(token, casbin.ResourceApplications, casbin.ActionUpdate, object)
106-
ctx, _ := context.WithTimeout(r.Context(), 60*time.Second)
106+
ctx, cancel := context.WithTimeout(r.Context(), 60*time.Second)
107107
ctx = util2.SetSuperAdminInContext(ctx, isSuperAdmin)
108-
108+
defer cancel()
109109
res, err := handler.deploymentConfigurationService.GetAllConfigData(ctx, configDataQueryParams, userHasAdminAccess)
110110
if err != nil {
111111
handler.logger.Errorw("service err, GetAllConfigData ", "err", err)

0 commit comments

Comments
 (0)