Commit 820e8673 authored by nanahira's avatar nanahira

fix lock

parent 3f7750af
Pipeline #25354 passed with stages
in 6 minutes and 56 seconds
......@@ -209,6 +209,18 @@ export class PackagerService extends ConsoleLogger {
}
async archive(root: string, archiveTask: ArchiveTask): Promise<Archive> {
const archive = archiveTask.archive;
const archiveName = archiveTask.archiveFullPath;
const existing = await this.s3.fileExists(archiveName);
if (existing) {
const hash = await this.appService.lookForExistingArchiveHash(archiveTask.path);
if (hash) {
archive.hash = hash;
archive.size = existing.Size;
this.log(`Archive ${archiveName} exists, skipping.`);
return archive;
}
}
return this.redlock.using([`archive:${archiveTask.path}`], 30000, async () => this.archiveProcess(root, archiveTask));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment