Update retry behavior for backed-up attachments

This commit is contained in:
trevor-signal 2025-08-18 13:53:04 -04:00 committed by GitHub
commit a7e22b14b3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 50 additions and 2 deletions

View file

@ -599,6 +599,7 @@ export const DataWriter: ServerWritableInterface = {
saveAttachmentDownloadJob,
saveAttachmentDownloadJobs,
resetAttachmentDownloadActive,
resetBackupAttachmentDownloadJobsRetryAfter,
removeAttachmentDownloadJob,
removeAttachmentDownloadJobsForMessage,
removeAllBackupAttachmentDownloadJobs,
@ -5746,6 +5747,16 @@ function resetAttachmentDownloadActive(db: WritableDB): void {
).run();
}
function resetBackupAttachmentDownloadJobsRetryAfter(db: WritableDB): void {
db.prepare(
`
UPDATE attachment_downloads
SET retryAfter = NULL
WHERE originalSource = 'backup_import'
`
).run();
}
function removeAttachmentDownloadJob(
db: WritableDB,
job: Pick<