Added background tasks queue

This commit is contained in:
Alex Tran 2022-02-09 21:23:01 -06:00
parent c5bf535209
commit 03b67a98d3
6 changed files with 73 additions and 665 deletions

View file

@ -0,0 +1,21 @@
import { BullModule } from '@nestjs/bull';
import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { AssetEntity } from '../../api-v1/asset/entities/asset.entity';
import { BackgroundTaskService } from './background-task.service';
@Module({
imports: [
BullModule.registerQueue({
name: 'background-task',
defaultJobOptions: {
attempts: 3,
removeOnComplete: true,
removeOnFail: false,
},
}),
TypeOrmModule.forFeature([AssetEntity]),
],
providers: [BackgroundTaskService],
})
export class BackgroundTaskModule {}