intuitive locking logs from the most important flow

pull/461/head
Frostebite 2022-10-05 02:56:23 +01:00
parent a34c72a0ad
commit 54c186f4cc
3 changed files with 9 additions and 1 deletions

3
dist/index.js vendored
View File

@ -666,13 +666,16 @@ class SharedWorkspaceLocking {
if (!cloud_runner_options_1.default.retainWorkspaces) { if (!cloud_runner_options_1.default.retainWorkspaces) {
return; return;
} }
cloud_runner_logger_1.default.log(`run agent ${runId} is trying to access a workspace`);
const workspaces = yield SharedWorkspaceLocking.GetFreeWorkspaces(); const workspaces = yield SharedWorkspaceLocking.GetFreeWorkspaces();
for (const element of workspaces) { for (const element of workspaces) {
if (yield SharedWorkspaceLocking.LockWorkspace(element, runId)) { if (yield SharedWorkspaceLocking.LockWorkspace(element, runId)) {
cloud_runner_logger_1.default.log(`run agent ${runId} locked workspace: ${element}`);
return element; return element;
} }
} }
const workspace = yield SharedWorkspaceLocking.CreateWorkspace(workspaceIfCreated, runId); 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; return workspace;
}); });
} }

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -23,14 +23,19 @@ export class SharedWorkspaceLocking {
return; return;
} }
CloudRunnerLogger.log(`run agent ${runId} is trying to access a workspace`);
const workspaces = await SharedWorkspaceLocking.GetFreeWorkspaces(); const workspaces = await SharedWorkspaceLocking.GetFreeWorkspaces();
for (const element of workspaces) { for (const element of workspaces) {
if (await SharedWorkspaceLocking.LockWorkspace(element, runId)) { if (await SharedWorkspaceLocking.LockWorkspace(element, runId)) {
CloudRunnerLogger.log(`run agent ${runId} locked workspace: ${element}`);
return element; return element;
} }
} }
const workspace = await SharedWorkspaceLocking.CreateWorkspace(workspaceIfCreated, runId); const workspace = await SharedWorkspaceLocking.CreateWorkspace(workspaceIfCreated, runId);
CloudRunnerLogger.log(`run agent ${runId} didn't find a free workspace so created: ${workspace}`);
return workspace; return workspace;
} }