refactor: introduce bindThis decorator to bind this automaticaly
This commit is contained in:
parent
e73581f715
commit
bbb49457f9
199 changed files with 969 additions and 96 deletions
|
@ -5,6 +5,7 @@ import type { Config } from '@/config.js';
|
|||
import { CleanRemoteFilesProcessorService } from './processors/CleanRemoteFilesProcessorService.js';
|
||||
import { DeleteFileProcessorService } from './processors/DeleteFileProcessorService.js';
|
||||
import type Bull from 'bull';
|
||||
import { bindThis } from '@/decorators.js';
|
||||
|
||||
@Injectable()
|
||||
export class ObjectStorageQueueProcessorsService {
|
||||
|
@ -17,6 +18,7 @@ export class ObjectStorageQueueProcessorsService {
|
|||
) {
|
||||
}
|
||||
|
||||
@bindThis
|
||||
public start(q: Bull.Queue): void {
|
||||
q.process('deleteFile', 16, (job) => this.deleteFileProcessorService.process(job));
|
||||
q.process('cleanRemoteFiles', 16, (job, done) => this.cleanRemoteFilesProcessorService.process(job, done));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue