Skip to content

Commit 7b740b4

Browse files
fix: preserve cli timeout (#91)
Prevent using the API calls context in the wait commands, as it includes a 30s timeout, which is honored even though we're creating a child context with a 30m timeout later. Rely on the cmd.Context() instead, so we preserve timeout behavior we want, either 30m by default, or the one specified via flags to the cli.
1 parent a6dcd9c commit 7b740b4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

internal/tiger/cmd/service.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ Note: You can specify both CPU and memory together, or specify only one (the oth
403403
} else {
404404
// Wait for service to be ready
405405
fmt.Fprintf(statusOutput, "⏳ Waiting for service to be ready (wait timeout: %v)...\n", createWaitTimeout)
406-
service.Status, serviceErr = waitForServiceReady(ctx, client, projectID, serviceID, createWaitTimeout, service.Status, statusOutput)
406+
service.Status, serviceErr = waitForServiceReady(cmd.Context(), client, projectID, serviceID, createWaitTimeout, service.Status, statusOutput)
407407
if serviceErr != nil {
408408
fmt.Fprintf(statusOutput, "❌ Error: %s\n", serviceErr)
409409
} else {
@@ -1252,7 +1252,7 @@ Examples:
12521252
} else {
12531253
// Wait for service to be ready
12541254
fmt.Fprintf(statusOutput, "⏳ Waiting for fork to complete (timeout: %v)...\n", forkWaitTimeout)
1255-
forkedService.Status, serviceErr = waitForServiceReady(ctx, client, projectID, forkedServiceID, forkWaitTimeout, forkedService.Status, statusOutput)
1255+
forkedService.Status, serviceErr = waitForServiceReady(cmd.Context(), client, projectID, forkedServiceID, forkWaitTimeout, forkedService.Status, statusOutput)
12561256
if serviceErr != nil {
12571257
fmt.Fprintf(statusOutput, "❌ Error: %s\n", serviceErr)
12581258
} else {

0 commit comments

Comments
 (0)