consider lock folders without workspace file locked

pull/461/head
Frostebite 2022-10-05 03:15:00 +01:00
parent 8ec7c6c485
commit 60a142b8de
3 changed files with 19 additions and 5 deletions

9
dist/index.js vendored
View File

@ -710,8 +710,13 @@ class SharedWorkspaceLocking {
return false; return false;
} }
const files = yield SharedWorkspaceLocking.ReadLines(`aws s3 ls ${SharedWorkspaceLocking.workspaceRoot}${workspace}/`); const files = yield SharedWorkspaceLocking.ReadLines(`aws s3 ls ${SharedWorkspaceLocking.workspaceRoot}${workspace}/`);
// 1 Because we expect 1 workspace file to exist in every workspace folder const workspaceFileDoesNotExists = files.filter((x) => {
return files.length > 1; return x.includes(`_workspace`);
}).length === 0;
const lockFilesExist = files.filter((x) => {
return x.includes(`_lock`);
}).length > 0;
return workspaceFileDoesNotExists || lockFilesExist;
}); });
} }
static CreateWorkspace(workspace, lockId = ``) { static CreateWorkspace(workspace, lockId = ``) {

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -71,8 +71,17 @@ export class SharedWorkspaceLocking {
`aws s3 ls ${SharedWorkspaceLocking.workspaceRoot}${workspace}/`, `aws s3 ls ${SharedWorkspaceLocking.workspaceRoot}${workspace}/`,
); );
// 1 Because we expect 1 workspace file to exist in every workspace folder const workspaceFileDoesNotExists =
return files.length > 1; files.filter((x) => {
return x.includes(`_workspace`);
}).length === 0;
const lockFilesExist =
files.filter((x) => {
return x.includes(`_lock`);
}).length > 0;
return workspaceFileDoesNotExists || lockFilesExist;
} }
public static async CreateWorkspace(workspace: string, lockId: string = ``) { public static async CreateWorkspace(workspace: string, lockId: string = ``) {