Revert "enhance(backend): migrate bull to bullmq (#10910)"
This reverts commit fd7b77c542.
This commit is contained in:
parent
cc87ef9e76
commit
9b3a92e999
42 changed files with 509 additions and 542 deletions
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue