Skip to content

Commit

Permalink
fix: Add env variable to worker timeout configuration. (#618)
Browse files Browse the repository at this point in the history
Co-authored-by: PulpDood <[email protected]>
  • Loading branch information
tjholm and pulpdood authored May 27, 2024
1 parent 15c1b16 commit 811df85
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions cloud/common/deploy/image/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ func NewImage(ctx *pulumi.Context, name string, args *ImageArgs, opts ...pulumi.
}

buildContext := fmt.Sprintf("%s/build-%s", os.TempDir(), name)
//#nosec G301 - Patch to remove exec perms
err = os.MkdirAll(buildContext, os.ModePerm)
if err != nil {
return nil, err
Expand Down
1 change: 1 addition & 0 deletions core/pkg/env/variables.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package env
var (
MAX_WORKERS = GetEnv("MAX_WORKERS", "300")
MIN_WORKERS = GetEnv("MIN_WORKERS", "1")
WORKER_TIMEOUT = GetEnv("WORKER_TIMEOUT", "10")
SERVICE_ADDRESS = GetEnv("SERVICE_ADDRESS", "127.0.0.1:50051")
LOG_LEVEL = GetEnv("LOG_LEVEL", "INFO")
)
5 changes: 4 additions & 1 deletion core/pkg/membrane/membrane.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,11 @@ func New(options *MembraneOptions) (*Membrane, error) {
return nil, err
}

workerTimeout, err := env.WORKER_TIMEOUT.Int()
if options.ChildTimeoutSeconds < 1 {
options.ChildTimeoutSeconds = 10
options.ChildTimeoutSeconds = workerTimeout
} else if err != nil {
return nil, err
}

if options.GatewayPlugin == nil {
Expand Down

0 comments on commit 811df85

Please sign in to comment.