We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b49102c commit aa40ed5Copy full SHA for aa40ed5
components/gitpod-protocol/src/gitpod-service.ts
@@ -363,11 +363,12 @@ const WORKSPACE_MAXIMUM_TIMEOUT_HOURS = 24;
363
export type WorkspaceTimeoutDuration = string;
364
export namespace WorkspaceTimeoutDuration {
365
export function validate(duration: string): WorkspaceTimeoutDuration {
366
+ duration = duration.toLowerCase();
367
const unit = duration.slice(-1);
368
if (!["m", "h", "d"].includes(unit)) {
369
throw new Error(`Invalid timeout unit: ${unit}`);
370
}
- const value = parseInt(duration.slice(0, -1));
371
+ const value = parseInt(duration.slice(0, -1), 10);
372
if (isNaN(value) || value <= 0) {
373
throw new Error(`Invalid timeout value: ${duration}`);
374
0 commit comments