Commit b9138d83 authored by nanahira's avatar nanahira

fix

parent 264d39ff
Pipeline #39411 passed with stages
in 4 minutes and 32 seconds
......@@ -159,11 +159,15 @@ export class UpdateService extends ConsoleLogger {
}
async getFullPackageMetalink(id: string, depotDto: DepotDto, version: string, ip: string) {
const tryRole = (role: ArchiveType) =>
this.getArchives(id, depotDto, version, (qb) =>
qb.select(['archive.hash', 'archive.path', 'archive.size']).andWhere('archive.role = :role', { role })
const tryRole = (role: ArchiveType, noErrorExit = false) =>
this.getArchives(
id,
depotDto,
version,
(qb) => qb.select(['archive.hash', 'archive.path', 'archive.size']).andWhere('archive.role = :role', { role }),
noErrorExit
);
let archives = await tryRole(ArchiveType.Fulls);
let archives = await tryRole(ArchiveType.Fulls, true);
if (!archives.length) {
archives = await tryRole(ArchiveType.Full);
}
......
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