2021-04-29 23:02:27 +00:00
|
|
|
// Copyright 2021 Signal Messenger, LLC
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2021-07-23 17:23:50 +00:00
|
|
|
import type { WebAPIType } from '../textsecure/WebAPI';
|
|
|
|
|
2021-08-31 20:58:39 +00:00
|
|
|
import { normalMessageSendJobQueue } from './normalMessageSendJobQueue';
|
2021-07-23 22:02:36 +00:00
|
|
|
import { readSyncJobQueue } from './readSyncJobQueue';
|
2021-04-29 23:02:27 +00:00
|
|
|
import { removeStorageKeyJobQueue } from './removeStorageKeyJobQueue';
|
2021-05-27 20:17:05 +00:00
|
|
|
import { reportSpamJobQueue } from './reportSpamJobQueue';
|
2021-08-12 18:15:55 +00:00
|
|
|
import { viewSyncJobQueue } from './viewSyncJobQueue';
|
2021-08-17 15:43:26 +00:00
|
|
|
import { viewedReceiptsJobQueue } from './viewedReceiptsJobQueue';
|
2021-04-29 23:02:27 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Start all of the job queues. Should be called when the database is ready.
|
|
|
|
*/
|
2021-07-23 17:23:50 +00:00
|
|
|
export function initializeAllJobQueues({
|
|
|
|
server,
|
|
|
|
}: {
|
|
|
|
server: WebAPIType;
|
|
|
|
}): void {
|
|
|
|
reportSpamJobQueue.initialize({ server });
|
|
|
|
|
2021-08-31 20:58:39 +00:00
|
|
|
normalMessageSendJobQueue.streamJobs();
|
2021-07-23 22:02:36 +00:00
|
|
|
readSyncJobQueue.streamJobs();
|
2021-04-29 23:02:27 +00:00
|
|
|
removeStorageKeyJobQueue.streamJobs();
|
2021-05-27 20:17:05 +00:00
|
|
|
reportSpamJobQueue.streamJobs();
|
2021-08-12 18:15:55 +00:00
|
|
|
viewSyncJobQueue.streamJobs();
|
2021-08-17 15:43:26 +00:00
|
|
|
viewedReceiptsJobQueue.streamJobs();
|
2021-04-29 23:02:27 +00:00
|
|
|
}
|