feat(server/web) Add manual job trigger mechanism to the web (#767)

This commit is contained in:
Alex 2022-10-06 11:25:54 -05:00 committed by GitHub
parent 854c214bc0
commit 7587f858ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
75 changed files with 3052 additions and 238 deletions

View file

@ -1,5 +1,5 @@
import { AssetEntity } from '@app/database/entities/asset.entity';
import { generateChecksumQueueName } from '@app/job';
import { QueueNameEnum } from '@app/job';
import { Process, Processor } from '@nestjs/bull';
import { Logger } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
@ -8,7 +8,7 @@ import fs from 'node:fs';
import { FindOptionsWhere, IsNull, MoreThan, QueryFailedError, Repository } from 'typeorm';
// TODO: just temporary task to generate previous uploaded assets.
@Processor(generateChecksumQueueName)
@Processor(QueueNameEnum.CHECKSUM_GENERATION)
export class GenerateChecksumProcessor {
constructor(
@InjectRepository(AssetEntity)
@ -33,7 +33,7 @@ export class GenerateChecksumProcessor {
const assets = await this.assetRepository.find({
where: whereStat,
take: pageSize,
order: { id: 'ASC' }
order: { id: 'ASC' },
});
if (!assets?.length) {