signal-desktop/ts/jobs/initializeAllJobQueues.ts

30 lines
966 B
TypeScript
Raw Normal View History

2021-04-29 23:02:27 +00:00
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type { WebAPIType } from '../textsecure/WebAPI';
import { normalMessageSendJobQueue } from './normalMessageSendJobQueue';
import { readSyncJobQueue } from './readSyncJobQueue';
2021-04-29 23:02:27 +00:00
import { removeStorageKeyJobQueue } from './removeStorageKeyJobQueue';
import { reportSpamJobQueue } from './reportSpamJobQueue';
import { viewSyncJobQueue } from './viewSyncJobQueue';
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.
*/
export function initializeAllJobQueues({
server,
}: {
server: WebAPIType;
}): void {
reportSpamJobQueue.initialize({ server });
normalMessageSendJobQueue.streamJobs();
readSyncJobQueue.streamJobs();
2021-04-29 23:02:27 +00:00
removeStorageKeyJobQueue.streamJobs();
reportSpamJobQueue.streamJobs();
viewSyncJobQueue.streamJobs();
viewedReceiptsJobQueue.streamJobs();
2021-04-29 23:02:27 +00:00
}