signal-desktop/ts/jobs/initializeAllJobQueues.ts
2021-07-23 15:02:36 -07:00

23 lines
657 B
TypeScript

// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type { WebAPIType } from '../textsecure/WebAPI';
import { readSyncJobQueue } from './readSyncJobQueue';
import { removeStorageKeyJobQueue } from './removeStorageKeyJobQueue';
import { reportSpamJobQueue } from './reportSpamJobQueue';
/**
* Start all of the job queues. Should be called when the database is ready.
*/
export function initializeAllJobQueues({
server,
}: {
server: WebAPIType;
}): void {
reportSpamJobQueue.initialize({ server });
readSyncJobQueue.streamJobs();
removeStorageKeyJobQueue.streamJobs();
reportSpamJobQueue.streamJobs();
}