diff --git a/components/server/src/workspace/garbage-collector.ts b/components/server/src/workspace/garbage-collector.ts index 989a5b1121aa22..88fa796617e428 100644 --- a/components/server/src/workspace/garbage-collector.ts +++ b/components/server/src/workspace/garbage-collector.ts @@ -43,8 +43,9 @@ export class WorkspaceGarbageCollector { } public async garbageCollectWorkspacesIfLeader() { + const initialLockDurationMs = this.config.workspaceGarbageCollection.intervalSeconds * 1000; try { - await this.mutex.client().using(["workspace-gc"], 30 * 1000, async (signal) => { + await this.mutex.client().using(["workspace-gc"], initialLockDurationMs, async (signal) => { log.info("wsgc: acquired workspace-gc lock. Collecting old workspaces"); try { await this.softDeleteOldWorkspaces();