pull/496/head
Frostebite 2023-02-18 22:57:00 +00:00
parent e898fb615d
commit fdd143849b
4 changed files with 7 additions and 4 deletions

3
dist/index.js generated vendored
View File

@ -5740,7 +5740,8 @@ class SharedWorkspaceLocking {
} }
return (yield SharedWorkspaceLocking.ReadLines(`aws s3 ls ${SharedWorkspaceLocking.workspaceRoot}${buildParametersContext.cacheKey}/`)) return (yield SharedWorkspaceLocking.ReadLines(`aws s3 ls ${SharedWorkspaceLocking.workspaceRoot}${buildParametersContext.cacheKey}/`))
.map((x) => x.replace(`/`, ``)) .map((x) => x.replace(`/`, ``))
.filter((x) => x.endsWith(`_workspace`)); .filter((x) => x.endsWith(`_workspace`))
.map((x) => `${x.split(`_`)[1]}_${x.split(`_`)[2]}`);
}); });
} }
static DoesCacheKeyTopLevelExist(buildParametersContext) { static DoesCacheKeyTopLevelExist(buildParametersContext) {

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View File

@ -22,7 +22,8 @@ export class SharedWorkspaceLocking {
) )
) )
.map((x) => x.replace(`/`, ``)) .map((x) => x.replace(`/`, ``))
.filter((x) => x.endsWith(`_workspace`)); .filter((x) => x.endsWith(`_workspace`))
.map((x) => `${x.split(`_`)[1]}_${x.split(`_`)[2]}`);
} }
public static async DoesCacheKeyTopLevelExist(buildParametersContext: BuildParameters) { public static async DoesCacheKeyTopLevelExist(buildParametersContext: BuildParameters) {
const lines = await SharedWorkspaceLocking.ReadLines(`aws s3 ls ${SharedWorkspaceLocking.workspaceRoot}`); const lines = await SharedWorkspaceLocking.ReadLines(`aws s3 ls ${SharedWorkspaceLocking.workspaceRoot}`);

View File

@ -230,7 +230,8 @@ describe('Cloud Runner Locking', () => {
expect(lockFilesExist).toBeTruthy(); expect(lockFilesExist).toBeTruthy();
const result: string[] = []; const result: string[] = [];
const workspaces = await SharedWorkspaceLocking.GetAllWorkspaces(buildParameters); const workspaces = await SharedWorkspaceLocking.GetAllWorkspaces(buildParameters);
for (const element of workspaces) { for (let element of workspaces) {
element = `${element.split(`_`)[1]}_${element.split(`_`)[2]}`;
await new Promise((promise) => setTimeout(promise, 1500)); await new Promise((promise) => setTimeout(promise, 1500));
const isLocked = await SharedWorkspaceLocking.IsWorkspaceLocked(element, buildParameters); const isLocked = await SharedWorkspaceLocking.IsWorkspaceLocked(element, buildParameters);
const isBelowMax = await SharedWorkspaceLocking.IsWorkspaceBelowMax(element, buildParameters); const isBelowMax = await SharedWorkspaceLocking.IsWorkspaceBelowMax(element, buildParameters);