pull/496/head
Frostebite 2023-02-19 00:47:35 +00:00
parent c998f7ceee
commit cf55eba4c5
4 changed files with 4 additions and 4 deletions

2
dist/index.js generated vendored
View File

@ -5741,7 +5741,7 @@ 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]}`); .map((x) => x.split(`_`)[1]);
}); });
} }
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

@ -23,7 +23,7 @@ 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]}`); .map((x) => x.split(`_`)[1]);
} }
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

@ -187,7 +187,7 @@ describe('Cloud Runner Locking', () => {
expect( expect(
await SharedWorkspaceLocking.GetOrCreateLockedWorkspace(newWorkspaceName, runId2, buildParameters), await SharedWorkspaceLocking.GetOrCreateLockedWorkspace(newWorkspaceName, runId2, buildParameters),
).toBeTruthy(); ).toBeTruthy();
expect(CloudRunner.lockedWorkspace).not.toMatch(newWorkspaceName); expect(CloudRunner.lockedWorkspace).not.toContain(newWorkspaceName);
}, 150000); }, 150000);
it(`0 free workspaces after locking`, async () => { it(`0 free workspaces after locking`, async () => {
Cli.options.retainWorkspaces = true; Cli.options.retainWorkspaces = true;