extract lib in caching flow

pull/496/head
Frostebite 2023-02-13 18:54:29 +00:00
parent f49ad49fc4
commit a08030a034
3 changed files with 7 additions and 3 deletions

4
dist/index.js generated vendored
View File

@ -5853,7 +5853,9 @@ class SharedWorkspaceLocking {
}
static LockWorkspace(workspace, runId, buildParametersContext) {
return __awaiter(this, void 0, void 0, function* () {
const file = `${Date.now()}_${runId}_${workspace}_workspace_lock`;
const existingWorkspace = workspace.endsWith(`_workspace`);
const ending = existingWorkspace ? workspace : `${workspace}_workspace`;
const file = `${Date.now()}_${runId}_${ending}_lock`;
fs.writeFileSync(file, '');
yield cloud_runner_system_1.CloudRunnerSystem.Run(`aws s3 cp ./${file} ${SharedWorkspaceLocking.workspaceRoot}${buildParametersContext.cacheKey}/${file}`, false, true);
fs.rmSync(file);

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View File

@ -241,7 +241,9 @@ export class SharedWorkspaceLocking {
runId: string,
buildParametersContext: BuildParameters,
): Promise<boolean> {
const file = `${Date.now()}_${runId}_${workspace}_workspace_lock`;
const existingWorkspace = workspace.endsWith(`_workspace`);
const ending = existingWorkspace ? workspace : `${workspace}_workspace`;
const file = `${Date.now()}_${runId}_${ending}_lock`;
fs.writeFileSync(file, '');
await CloudRunnerSystem.Run(
`aws s3 cp ./${file} ${SharedWorkspaceLocking.workspaceRoot}${buildParametersContext.cacheKey}/${file}`,