mirror of
https://github.com/samsonjs/immich.git
synced 2026-03-31 10:15:54 +00:00
CI will now run linter, type-checks and tests for the server. All the lint issues have been fixed.
23 lines
616 B
TypeScript
23 lines
616 B
TypeScript
import { InjectQueue } from '@nestjs/bull/dist/decorators';
|
|
import { Injectable } from '@nestjs/common';
|
|
import { Queue } from 'bull';
|
|
import { randomUUID } from 'node:crypto';
|
|
import { AssetResponseDto } from '../../api-v1/asset/response-dto/asset-response.dto';
|
|
|
|
@Injectable()
|
|
export class BackgroundTaskService {
|
|
constructor(
|
|
@InjectQueue('background-task')
|
|
private backgroundTaskQueue: Queue,
|
|
) {}
|
|
|
|
async deleteFileOnDisk(assets: AssetResponseDto[]) {
|
|
await this.backgroundTaskQueue.add(
|
|
'delete-file-on-disk',
|
|
{
|
|
assets,
|
|
},
|
|
{ jobId: randomUUID() },
|
|
);
|
|
}
|
|
}
|