Skip to content

fix: increase default extension time #2172

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

Merged
merged 2 commits into from
Jun 8, 2022
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
4 changes: 2 additions & 2 deletions site/src/util/workspace.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe("util > workspace", () => {
[
"2022-06-02T14:56:34Z",
{
deadline: "2022-06-02T16:26:34Z",
deadline: "2022-06-02T18:56:34Z",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review:

It was previously 90 minutes, now it's 4 hours. So this adds 2.5 hours.

},
],

Expand All @@ -56,7 +56,7 @@ describe("util > workspace", () => {
[
"2022-06-02T10:56:20-04:00",
{
deadline: "2022-06-02T16:26:20Z",
deadline: "2022-06-02T18:56:20Z",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review:

It was previously 90 minutes, now it's 4 hours. So this adds 2.5 hours.

},
],
])(`defaultWorkspaceExtension(%p) returns %p`, (startTime, request) => {
Expand Down
4 changes: 2 additions & 2 deletions site/src/util/workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,10 @@ export const isWorkspaceOn = (workspace: TypesGen.Workspace): boolean => {

export const defaultWorkspaceExtension = (__startDate?: dayjs.Dayjs): TypesGen.PutExtendWorkspaceRequest => {
const now = __startDate ? dayjs(__startDate) : dayjs()
const NinetyMinutesFromNow = now.add(90, "minutes").utc()
const fourHoursFromNow = now.add(4, "hours").utc()

return {
deadline: NinetyMinutesFromNow.format(),
deadline: fourHoursFromNow.format(),
}
}

Expand Down