Skip to content

Commit

Permalink
fix(Job-Engine): Fixed a bug on the timeout of deployment stop (#99)
Browse files Browse the repository at this point in the history
  • Loading branch information
ignacio-penas authored Nov 11, 2024
1 parent 42127d1 commit 2784b5c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion common/constants/timeouts.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package constants

const (
DefaultJobTimeout = 300
DefaultJobTimeout = 300
DefaultPullTimeout = 1200
)
4 changes: 3 additions & 1 deletion workers/job_processor/actions/deployment_stop.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import (
"fmt"
"github.com/nuvla/api-client-go/clients/resources"
log "github.com/sirupsen/logrus"
"nuvlaedge-go/common/constants"
"nuvlaedge-go/workers/job_processor/executors"
"time"
)

type DeploymentStop struct {
Expand All @@ -16,7 +18,7 @@ func (d *DeploymentStop) ExecuteAction(ctx context.Context) error {
defer CloseDeploymentClientWithLog(d.client)
defer d.executor.Close()

ctxTimed, cancel := context.WithTimeout(ctx, 60)
ctxTimed, cancel := context.WithTimeout(ctx, constants.DefaultJobTimeout*time.Second)
defer cancel()

if err := d.client.SetState(ctxTimed, resources.StateStopping); err != nil {
Expand Down

0 comments on commit 2784b5c

Please sign in to comment.