Commit 876560a3 authored by nanahira's avatar nanahira

use existing archive only when archive record exists

parent 3b7d72ed
Pipeline #4985 passed with stages
in 2 minutes and 48 seconds
......@@ -181,9 +181,10 @@ export class PackagerService extends ConsoleLogger {
const archiveName = archiveTask.archiveFullPath;
const existing = await this.s3.fileExists(archiveName);
if (existing) {
archive.size = existing.Size;
const hash = await this.appService.lookForExistingArchiveHash(archiveTask.path);
if (hash) {
this.log(`Archive ${archiveName} exists, skipping.`);
archive.size = existing.Size;
archive.hash = hash;
return archive;
}
......@@ -209,11 +210,11 @@ export class PackagerService extends ConsoleLogger {
child.stdout.on('data', (chunk) => {
hashObject.update(chunk);
});
if (existing) {
/* if (existing) {
await childPromise;
archive.hash = hashObject.digest('hex');
return archive;
}
}*/
const uploadPromise = this.s3.uploadStream(archiveName, child.stdout, {
ContentType: 'application/tar+zstd',
});
......
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