intuitive locking logs from the most important flow
parent
a34c72a0ad
commit
54c186f4cc
|
|
@ -666,13 +666,16 @@ class SharedWorkspaceLocking {
|
|||
if (!cloud_runner_options_1.default.retainWorkspaces) {
|
||||
return;
|
||||
}
|
||||
cloud_runner_logger_1.default.log(`run agent ${runId} is trying to access a workspace`);
|
||||
const workspaces = yield SharedWorkspaceLocking.GetFreeWorkspaces();
|
||||
for (const element of workspaces) {
|
||||
if (yield SharedWorkspaceLocking.LockWorkspace(element, runId)) {
|
||||
cloud_runner_logger_1.default.log(`run agent ${runId} locked workspace: ${element}`);
|
||||
return element;
|
||||
}
|
||||
}
|
||||
const workspace = yield SharedWorkspaceLocking.CreateWorkspace(workspaceIfCreated, runId);
|
||||
cloud_runner_logger_1.default.log(`run agent ${runId} didn't find a free workspace so created: ${workspace}`);
|
||||
return workspace;
|
||||
});
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -23,14 +23,19 @@ export class SharedWorkspaceLocking {
|
|||
return;
|
||||
}
|
||||
|
||||
CloudRunnerLogger.log(`run agent ${runId} is trying to access a workspace`);
|
||||
|
||||
const workspaces = await SharedWorkspaceLocking.GetFreeWorkspaces();
|
||||
for (const element of workspaces) {
|
||||
if (await SharedWorkspaceLocking.LockWorkspace(element, runId)) {
|
||||
CloudRunnerLogger.log(`run agent ${runId} locked workspace: ${element}`);
|
||||
|
||||
return element;
|
||||
}
|
||||
}
|
||||
|
||||
const workspace = await SharedWorkspaceLocking.CreateWorkspace(workspaceIfCreated, runId);
|
||||
CloudRunnerLogger.log(`run agent ${runId} didn't find a free workspace so created: ${workspace}`);
|
||||
|
||||
return workspace;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue