@@ -58,10 +58,6 @@ import (
5858 "github.com/koderover/zadig/v2/pkg/util"
5959)
6060
61- var (
62- defaultTimeout = time .Second * 30
63- )
64-
6561func CreateReleasePlan (c * handler.Context , args * models.ReleasePlan ) error {
6662 if args .Name == "" || args .ManagerID == "" {
6763 return errors .New ("Required parameters are missing" )
@@ -420,8 +416,7 @@ func UpdateReleasePlan(c *handler.Context, planID string, args *UpdateReleasePla
420416 }
421417 defer planLock .Unlock ()
422418
423- ctx , cancel := context .WithTimeout (context .Background (), defaultTimeout )
424- defer cancel ()
419+ ctx := context .Background ()
425420 plan , err := mongodb .NewReleasePlanColl ().GetByID (ctx , planID )
426421 if err != nil {
427422 return errors .Wrap (err , "get plan" )
@@ -614,8 +609,7 @@ func ExecuteReleaseJob(c *handler.Context, planID string, args *ExecuteReleaseJo
614609 approveLock .Lock ()
615610 defer approveLock .Unlock ()
616611
617- ctx , cancel := context .WithTimeout (context .Background (), defaultTimeout )
618- defer cancel ()
612+ ctx := context .Background ()
619613 plan , err := mongodb .NewReleasePlanColl ().GetByID (ctx , planID )
620614 if err != nil {
621615 return errors .Wrap (err , "get plan" )
@@ -726,8 +720,7 @@ func RetryReleaseJob(c *handler.Context, planID string, args *RetryReleaseJobArg
726720 approveLock .Lock ()
727721 defer approveLock .Unlock ()
728722
729- ctx , cancel := context .WithTimeout (context .Background (), defaultTimeout )
730- defer cancel ()
723+ ctx := context .Background ()
731724 plan , err := mongodb .NewReleasePlanColl ().GetByID (ctx , planID )
732725 if err != nil {
733726 return errors .Wrap (err , "get plan" )
@@ -1002,8 +995,7 @@ func SkipReleaseJob(c *handler.Context, planID string, args *SkipReleaseJobArgs,
1002995 approveLock .Lock ()
1003996 defer approveLock .Unlock ()
1004997
1005- ctx , cancel := context .WithTimeout (context .Background (), defaultTimeout )
1006- defer cancel ()
998+ ctx := context .Background ()
1007999 plan , err := mongodb .NewReleasePlanColl ().GetByID (ctx , planID )
10081000 if err != nil {
10091001 return errors .Wrap (err , "get plan" )
@@ -1101,8 +1093,7 @@ func UpdateReleasePlanStatus(c *handler.Context, planID, targetStatus string, is
11011093 approveLock .Lock ()
11021094 defer approveLock .Unlock ()
11031095
1104- ctx , cancel := context .WithTimeout (context .Background (), defaultTimeout )
1105- defer cancel ()
1096+ ctx := context .Background ()
11061097 plan , err := mongodb .NewReleasePlanColl ().GetByID (ctx , planID )
11071098 if err != nil {
11081099 return errors .Wrap (err , "get plan" )
@@ -1317,8 +1308,7 @@ func ApproveReleasePlan(c *handler.Context, planID string, req *ApproveRequest)
13171308 approveLock .Lock ()
13181309 defer approveLock .Unlock ()
13191310
1320- ctx , cancel := context .WithTimeout (context .Background (), defaultTimeout )
1321- defer cancel ()
1311+ ctx := context .Background ()
13221312 plan , err := mongodb .NewReleasePlanColl ().GetByID (ctx , planID )
13231313 if err != nil {
13241314 return errors .Wrap (err , "get plan" )
0 commit comments