Commit 14175a8f authored by nanahira's avatar nanahira

pick latest hash in edge case

parent 9251c31a
Pipeline #15210 passed with stages
in 4 minutes and 2 seconds
......@@ -343,9 +343,9 @@ export class AppService extends ConsoleLogger {
}
async lookForExistingArchiveHash(path: string) {
const archive = await this.db.getRepository(Archive).findOne({ where: { path, hash: Not(IsNull()) }, select: ['hash'] });
if (archive) {
return archive.hash;
const archives = await this.db.getRepository(Archive).find({ where: { path, hash: Not(IsNull()) }, select: ['hash'], order: { id: 'DESC' } });
if (archives.length) {
return archives[0].hash;
}
return null;
// return this.checkHashFromUrl(`${this.packageS3.cdnUrl}/${path}.tar.zst`);
......
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