feat(deploy): set timeout via label #290

Merged
moritz merged 2 commits from set_timeout into main 2023-04-14 14:44:23 +00:00
Member

Solves coop-cloud/organising#437

A timeout can be specified globally for a recipe using this label:
coop-cloud.${STACK_NAME}.timeout=${TIMEOUT:-120}. This sets the default timeout to 120s. An app specific timeout can be set using the env TIMEOUT.

Solves https://git.coopcloud.tech/coop-cloud/organising/issues/437 A timeout can be specified globally for a recipe using this label: `coop-cloud.${STACK_NAME}.timeout=${TIMEOUT:-120}`. This sets the default timeout to 120s. An app specific timeout can be set using the env `TIMEOUT`.
decentral1se reviewed 2023-04-14 11:47:16 +00:00
decentral1se left a comment
Owner

Solid stuff, few minor comments also! Thanks!

Solid stuff, few minor comments also! Thanks!
@ -201,6 +202,15 @@ recipes.
logrus.Fatal(err)
}
timeoutLabel := config.GetLabel(compose, stackName, "timeout")
Owner

Since we do this GetLabel / strconv.Atoi(timeoutLabel) twice already, should we also publish a config.GetTimeoutLabel API which does this all internally? Then the surface can be:

stack.WaitTimeout, err = config.GetTimeoutLabel(...)
if err != nil {
 ...
}
Since we do this `GetLabel` / `strconv.Atoi(timeoutLabel)` twice already, should we also publish a `config.GetTimeoutLabel` API which does this all internally? Then the surface can be: ```go stack.WaitTimeout, err = config.GetTimeoutLabel(...) if err != nil { ... } ```
moritz marked this conversation as resolved
@ -31,6 +31,8 @@ const (
ResolveImageNever = "never"
)
var WaitTimeout int = 50
Owner

Shall we doc string this also and mention 50 is random + legacy choice?

Shall we doc string this also and mention `50` is random + legacy choice?
moritz marked this conversation as resolved
moritz force-pushed set_timeout from bc109d77ec to c750db465d 2023-04-14 12:38:10 +00:00 Compare
moritz force-pushed set_timeout from f717cb4e14 to d3650b274e 2023-04-14 14:31:29 +00:00 Compare
moritz merged commit 31ec322c55 into main 2023-04-14 14:44:22 +00:00
moritz deleted branch set_timeout 2023-04-14 14:44:25 +00:00
Sign in to join this conversation.
No description provided.