Commit 2433c473 authored by nanahira's avatar nanahira

remove clock

parent 8862a77e
Pipeline #5292 passed with stages
in 5 minutes and 32 seconds
...@@ -207,8 +207,8 @@ export class UpdateService extends ConsoleLogger { ...@@ -207,8 +207,8 @@ export class UpdateService extends ConsoleLogger {
.leftJoin('build.archives', 'archive', 'archive.role = :partRole', { partRole: ArchiveType.Part }) .leftJoin('build.archives', 'archive', 'archive.role = :partRole', { partRole: ArchiveType.Part })
); );
// console.log(build.archives); // console.log(build.archives);
let clock = moment(); //let clock = moment();
this.log('part 1'); //this.log('part 1');
const tryExactArchiveQuery = this.db const tryExactArchiveQuery = this.db
.getRepository(Archive) .getRepository(Archive)
.createQueryBuilder('archive') .createQueryBuilder('archive')
...@@ -254,9 +254,9 @@ export class UpdateService extends ConsoleLogger { ...@@ -254,9 +254,9 @@ export class UpdateService extends ConsoleLogger {
.andWhere('archive.buildId = :buildId', { buildId: build.id }) .andWhere('archive.buildId = :buildId', { buildId: build.id })
.getRawMany() .getRawMany()
).map((obj) => obj.archiveId);*/ ).map((obj) => obj.archiveId);*/
this.log(`Time used: ${moment().diff(clock, 'seconds')} s`); //this.log(`Time used: ${moment().diff(clock, 'seconds')} s`);
clock = moment(); //clock = moment();
this.log('part 2'); //this.log('part 2');
const allPossiblePartArchives = await this.db const allPossiblePartArchives = await this.db
.getRepository(Archive) .getRepository(Archive)
.createQueryBuilder('archive') .createQueryBuilder('archive')
...@@ -280,13 +280,13 @@ export class UpdateService extends ConsoleLogger { ...@@ -280,13 +280,13 @@ export class UpdateService extends ConsoleLogger {
*/ */
//const allPartArchives = await allPartArchivesQuery.getMany(); //const allPartArchives = await allPartArchivesQuery.getMany();
this.log(`Time used: ${moment().diff(clock, 'seconds')} s`); //this.log(`Time used: ${moment().diff(clock, 'seconds')} s`);
clock = moment(); //clock = moment();
this.log('part 3'); //this.log('part 3');
const allPartArchives = this.pickArchives(allPossiblePartArchives, requestedFiles); const allPartArchives = this.pickArchives(allPossiblePartArchives, requestedFiles);
this.log(`Time used: ${moment().diff(clock, 'seconds')} s`); //this.log(`Time used: ${moment().diff(clock, 'seconds')} s`);
clock = moment(); //clock = moment();
this.log('part 4'); //this.log('part 4');
const fullArchive = await this.db const fullArchive = await this.db
.getRepository(Archive) .getRepository(Archive)
.createQueryBuilder('archive') .createQueryBuilder('archive')
...@@ -300,7 +300,7 @@ export class UpdateService extends ConsoleLogger { ...@@ -300,7 +300,7 @@ export class UpdateService extends ConsoleLogger {
if (!allPartArchives.length || (fullArchive && this.getCostOfArchives([fullArchive]) <= this.getCostOfArchives(allPartArchives))) { if (!allPartArchives.length || (fullArchive && this.getCostOfArchives([fullArchive]) <= this.getCostOfArchives(allPartArchives))) {
archives = [fullArchive]; archives = [fullArchive];
} }
this.log(`Time used: ${moment().diff(clock, 'seconds')} s`); //this.log(`Time used: ${moment().diff(clock, 'seconds')} s`);
return { return {
cdnUrl: this.cdnUrl, cdnUrl: this.cdnUrl,
archives, archives,
......
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