2021-08-19 04:33:41 -05:00
|
|
|
import { deliverQueue, inboxQueue, dbQueue, objectStorageQueue } from '@/queue/queues.js';
|
|
|
|
import define from '../../../define.js';
|
2019-03-07 22:03:38 -06:00
|
|
|
|
|
|
|
export const meta = {
|
|
|
|
tags: ['admin'],
|
|
|
|
|
2020-02-15 06:33:32 -06:00
|
|
|
requireCredential: true as const,
|
2019-03-07 22:03:38 -06:00
|
|
|
requireModerator: true,
|
|
|
|
|
2021-03-06 07:34:11 -06:00
|
|
|
params: {},
|
|
|
|
|
|
|
|
res: {
|
|
|
|
type: 'object' as const,
|
|
|
|
optional: false as const, nullable: false as const,
|
|
|
|
properties: {
|
|
|
|
deliver: {
|
|
|
|
ref: 'QueueCount'
|
|
|
|
},
|
|
|
|
inbox: {
|
|
|
|
ref: 'QueueCount'
|
|
|
|
},
|
|
|
|
db: {
|
|
|
|
ref: 'QueueCount'
|
|
|
|
},
|
|
|
|
objectStorage: {
|
|
|
|
ref: 'QueueCount'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-03-07 22:03:38 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
export default define(meta, async (ps) => {
|
|
|
|
const deliverJobCounts = await deliverQueue.getJobCounts();
|
2019-03-08 06:30:12 -06:00
|
|
|
const inboxJobCounts = await inboxQueue.getJobCounts();
|
2019-05-27 03:44:51 -05:00
|
|
|
const dbJobCounts = await dbQueue.getJobCounts();
|
|
|
|
const objectStorageJobCounts = await objectStorageQueue.getJobCounts();
|
2019-03-07 22:03:38 -06:00
|
|
|
|
|
|
|
return {
|
|
|
|
deliver: deliverJobCounts,
|
2019-05-27 03:44:51 -05:00
|
|
|
inbox: inboxJobCounts,
|
|
|
|
db: dbJobCounts,
|
|
|
|
objectStorage: objectStorageJobCounts,
|
2019-03-07 22:03:38 -06:00
|
|
|
};
|
|
|
|
});
|