enhance(backend): migrate bull to bullmq (#10910)
* wip
* wip
* Update QueueService.ts
* wip
* refactor
* ✌️
* fix
* Update QueueStatsService.ts
* refactor
* Update ApNoteService.ts
* Update mock-resolver.ts
* refactor
* Update mock-resolver.ts
This commit is contained in:
parent
7cbd852fe5
commit
fd7b77c542
53 changed files with 532 additions and 490 deletions
|
@ -6,7 +6,7 @@ import type Logger from '@/logger.js';
|
|||
import { NotificationService } from '@/core/NotificationService.js';
|
||||
import { bindThis } from '@/decorators.js';
|
||||
import { QueueLoggerService } from '../QueueLoggerService.js';
|
||||
import type Bull from 'bull';
|
||||
import type * as Bull from 'bullmq';
|
||||
import type { EndedPollNotificationJobData } from '../types.js';
|
||||
|
||||
@Injectable()
|
||||
|
@ -30,10 +30,9 @@ export class EndedPollNotificationProcessorService {
|
|||
}
|
||||
|
||||
@bindThis
|
||||
public async process(job: Bull.Job<EndedPollNotificationJobData>, done: () => void): Promise<void> {
|
||||
public async process(job: Bull.Job<EndedPollNotificationJobData>): Promise<void> {
|
||||
const note = await this.notesRepository.findOneBy({ id: job.data.noteId });
|
||||
if (note == null || !note.hasPoll) {
|
||||
done();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -51,7 +50,5 @@ export class EndedPollNotificationProcessorService {
|
|||
noteId: note.id,
|
||||
});
|
||||
}
|
||||
|
||||
done();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue