Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add env variable to worker timeout configuration. #618

Merged
merged 1 commit into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading