Retry outbound "normal" messages for up to a day
This commit is contained in:
parent
62cf51c060
commit
a85dd1be36
30 changed files with 1414 additions and 603 deletions
19
ts/jobs/formatJobForInsert.ts
Normal file
19
ts/jobs/formatJobForInsert.ts
Normal 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,
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue