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-12-07 22:41:40 +00:00
|
|
|
import { deliveryReceiptsJobQueue } from './deliveryReceiptsJobQueue';
|
2021-08-31 20:58:39 +00:00
|
|
|
import { normalMessageSendJobQueue } from './normalMessageSendJobQueue';
|
2021-10-29 23:19:44 +00:00
|
|
|
import { reactionJobQueue } from './reactionJobQueue';
|
2021-12-07 22:41:40 +00:00
|
|
|
import { readReceiptsJobQueue } from './readReceiptsJobQueue';
|
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-12-07 22:41:40 +00:00
|
|
|
deliveryReceiptsJobQueue.streamJobs();
|
2021-08-31 20:58:39 +00:00
|
|
|
normalMessageSendJobQueue.streamJobs();
|
2021-10-29 23:19:44 +00:00
|
|
|
reactionJobQueue.streamJobs();
|
2021-12-07 22:41:40 +00:00
|
|
|
readReceiptsJobQueue.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
|
|
|
}
|