mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-22 19:11:33 +03:00
Qfix default workspace mode (#6508)
Signed-off-by: Alexey Zinoviev <alexey.zinoviev@xored.com>
This commit is contained in:
parent
6784168b66
commit
7ad23c3443
@ -1490,11 +1490,16 @@ export async function getPendingWorkspace (
|
||||
operationQuery,
|
||||
attemptsQuery,
|
||||
region !== '' ? { region } : defaultRegionQuery,
|
||||
{ lastProcessingTime: { $lt: Date.now() - processingTimeoutMs } }
|
||||
{
|
||||
$or: [
|
||||
{ lastProcessingTime: { $exists: false } },
|
||||
{ lastProcessingTime: { $lt: Date.now() - processingTimeoutMs } }
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
return (
|
||||
const result =
|
||||
(await wsCollection.findOneAndUpdate(
|
||||
query,
|
||||
{
|
||||
@ -1512,7 +1517,19 @@ export async function getPendingWorkspace (
|
||||
}
|
||||
}
|
||||
)) ?? undefined
|
||||
)
|
||||
|
||||
if (result != null) {
|
||||
ctx.info('getPendingWorkspace', {
|
||||
workspaceId: result.workspace,
|
||||
mode: result.mode,
|
||||
workspaceName: result.workspaceName,
|
||||
operation,
|
||||
region,
|
||||
version
|
||||
})
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -220,7 +220,7 @@ export class WorkspaceWorker {
|
||||
workspace: BaseWorkspaceInfo,
|
||||
opt: WorkspaceOptions
|
||||
): Promise<void> {
|
||||
switch (workspace.mode) {
|
||||
switch (workspace.mode ?? 'active') {
|
||||
case 'creating':
|
||||
case 'pending-creation':
|
||||
// We need to either start workspace creation
|
||||
@ -237,6 +237,8 @@ export class WorkspaceWorker {
|
||||
// Seems we failed to delete, so let's restore deletion.
|
||||
// TODO: move from account
|
||||
break
|
||||
default:
|
||||
ctx.error('Unknown workspace mode', { workspace: workspace.workspace, mode: workspace.mode })
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user