Initial support for job queue
This commit is contained in:
parent
1238cca538
commit
bbd7fd3854
22 changed files with 1708 additions and 28 deletions
|
@ -33,6 +33,7 @@ import {
|
|||
ConversationModelCollectionType,
|
||||
MessageModelCollectionType,
|
||||
} from '../model-types.d';
|
||||
import { StoredJob } from '../jobs/types';
|
||||
|
||||
import {
|
||||
AttachmentDownloadJobType,
|
||||
|
@ -225,6 +226,10 @@ const dataInterface: ClientInterface = {
|
|||
getMessagesWithVisualMediaAttachments,
|
||||
getMessagesWithFileAttachments,
|
||||
|
||||
getJobsInQueue,
|
||||
insertJob,
|
||||
deleteJob,
|
||||
|
||||
// Test-only
|
||||
|
||||
_getAllMessages,
|
||||
|
@ -1491,3 +1496,15 @@ async function getMessagesWithFileAttachments(
|
|||
limit,
|
||||
});
|
||||
}
|
||||
|
||||
function getJobsInQueue(queueType: string): Promise<Array<StoredJob>> {
|
||||
return channels.getJobsInQueue(queueType);
|
||||
}
|
||||
|
||||
function insertJob(job: Readonly<StoredJob>): Promise<void> {
|
||||
return channels.insertJob(job);
|
||||
}
|
||||
|
||||
function deleteJob(id: string): Promise<void> {
|
||||
return channels.deleteJob(id);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue