Retry outbound "normal" messages for up to a day

This commit is contained in:
Evan Hahn 2021-08-31 15:58:39 -05:00 committed by GitHub
parent 62cf51c060
commit a85dd1be36
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
30 changed files with 1414 additions and 603 deletions

View file

@ -0,0 +1,19 @@
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type { ParsedJob, StoredJob } from './types';
/**
* Format a job to be inserted into the database.
*
* Notably, `Job` instances (which have a promise attached) cannot be serialized without
* some cleanup. That's what this function is most useful for.
*/
export const formatJobForInsert = (
job: Readonly<StoredJob | ParsedJob<unknown>>
): StoredJob => ({
id: job.id,
timestamp: job.timestamp,
queueType: job.queueType,
data: job.data,
});