forked from FoundKeyGang/FoundKey
Clean jobs
This commit is contained in:
parent
d283ec69f7
commit
8cc236daf8
1 changed files with 10 additions and 4 deletions
|
@ -8,6 +8,7 @@ import { program } from '../argv';
|
||||||
import processDeliver from './processors/deliver';
|
import processDeliver from './processors/deliver';
|
||||||
import processInbox from './processors/process-inbox';
|
import processInbox from './processors/process-inbox';
|
||||||
import processDb from './processors/db';
|
import processDb from './processors/db';
|
||||||
|
import { queueLogger } from './logger';
|
||||||
|
|
||||||
function initializeQueue(name: string) {
|
function initializeQueue(name: string) {
|
||||||
return new Queue(name, config.redis != null ? {
|
return new Queue(name, config.redis != null ? {
|
||||||
|
@ -124,8 +125,13 @@ export default function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function destroy() {
|
export function destroy() {
|
||||||
/*
|
deliverQueue.once('cleaned', (jobs, status) => {
|
||||||
queue.destroy().then(n => {
|
queueLogger.succ(`[deliver] Cleaned ${jobs.length} ${status} jobs`);
|
||||||
queueLogger.succ(`All job removed (${n} jobs)`);
|
});
|
||||||
});*/
|
deliverQueue.clean(0, 'wait');
|
||||||
|
|
||||||
|
inboxQueue.once('cleaned', (jobs, status) => {
|
||||||
|
queueLogger.succ(`[inbox] Cleaned ${jobs.length} ${status} jobs`);
|
||||||
|
});
|
||||||
|
inboxQueue.clean(0, 'wait');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue