Revert "enhance(backend): migrate bull to bullmq (#10910)"

This reverts commit fd7b77c542.
This commit is contained in:
riku6460 2023-06-15 02:57:13 +09:00
parent cc87ef9e76
commit 9b3a92e999
No known key found for this signature in database
GPG key ID: 27414FA27DB94CF6
42 changed files with 509 additions and 542 deletions

View file

@ -9,7 +9,7 @@ import { deepClone } from '@/misc/clone.js';
import { IdService } from '@/core/IdService.js';
import { isDuplicateKeyValueError } from '@/misc/is-duplicate-key-value-error.js';
import { QueueLoggerService } from '../QueueLoggerService.js';
import type * as Bull from 'bullmq';
import type Bull from 'bull';
@Injectable()
export class AggregateRetentionProcessorService {
@ -32,7 +32,7 @@ export class AggregateRetentionProcessorService {
}
@bindThis
public async process(): Promise<void> {
public async process(job: Bull.Job<Record<string, unknown>>, done: () => void): Promise<void> {
this.logger.info('Aggregating retention...');
const now = new Date();
@ -62,6 +62,7 @@ export class AggregateRetentionProcessorService {
} catch (err) {
if (isDuplicateKeyValueError(err)) {
this.logger.succ('Skip because it has already been processed by another worker.');
done();
return;
}
throw err;
@ -87,5 +88,6 @@ export class AggregateRetentionProcessorService {
}
this.logger.succ('Retention aggregated.');
done();
}
}