Skip to content

Commit 447796d

Browse files
committed
gp timeout set to echo back the server display duration
This means that 1439m doesn't become "1439 minutes", but rather "29 hours and 59 minutes"
1 parent e7427bd commit 447796d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

components/gitpod-cli/cmd/timeout-set.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,15 @@ For example, 30m, 1h, 5h, etc.`,
4545
if err != nil {
4646
return GpError{Err: err, OutCome: utils.Outcome_UserErr, ErrorCode: utils.UserErrorCode_InvalidArguments}
4747
}
48-
if _, err = client.SetWorkspaceTimeout(ctx, wsInfo.WorkspaceId, duration); err != nil {
48+
49+
res, err := client.SetWorkspaceTimeout(ctx, wsInfo.WorkspaceId, duration)
50+
if err != nil {
4951
if err, ok := err.(*jsonrpc2.Error); ok && err.Code == serverapi.PLAN_PROFESSIONAL_REQUIRED {
5052
return GpError{OutCome: utils.Outcome_UserErr, Message: "Cannot extend workspace timeout for current plan, please upgrade your plan", ErrorCode: utils.UserErrorCode_NeedUpgradePlan}
5153
}
5254
return err
5355
}
54-
fmt.Printf("Workspace timeout has been set to %d minutes.\n", int(duration.Minutes()))
56+
fmt.Printf("Workspace timeout has been set to %s.\n", res.HumanReadableDuration)
5557
return nil
5658
},
5759
}

0 commit comments

Comments
 (0)