extract lib in caching flow
parent
f49ad49fc4
commit
a08030a034
|
@ -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);
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -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}`,
|
||||
|
|
Loading…
Reference in New Issue