Commit 0c4a6cdf authored by nanahira's avatar nanahira

update upload sequence

parent 6c89a95b
Pipeline #17481 passed with stages
in 1 minute and 21 seconds
......@@ -130,7 +130,7 @@ export class MirrorService extends ConsoleLogger implements OnApplicationBootstr
private async runMirror() {
const query = this.db
.createQueryBuilder()
.select(['archive.path', 'archive.size', 'archive.hash'])
.select(['archive.id', 'archive.path', 'archive.size', 'archive.hash'])
.distinctOn(['archive.path'])
.from(Archive, 'archive')
.where('archive.size <= :maximumMirroredSize', { maximumMirroredSize: this.maximumMirroredSize });
......@@ -138,6 +138,7 @@ export class MirrorService extends ConsoleLogger implements OnApplicationBootstr
.andWhere(
`not exists ${query.subQuery().select('mirror.path').from(ArchiveMirror, 'mirror').where('archive.path = mirror.path').getQuery()}`
)
.orderBy('archive.id', 'DESC')
.take(this.mirrorConcurrent);
this.log(`Searching for archives to mirror`);
const archives = await query.getMany();
......
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