Enable attachment backup uploading

This commit is contained in:
trevor-signal 2024-05-29 19:46:43 -04:00 committed by GitHub
parent 94a262b799
commit 4254356812
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
27 changed files with 2054 additions and 534 deletions

View file

@ -204,6 +204,7 @@ import { onCallLinkUpdateSync } from './util/onCallLinkUpdateSync';
import { CallMode } from './types/Calling';
import { queueSyncTasks } from './util/syncTasks';
import { isEnabled } from './RemoteConfig';
import { AttachmentBackupManager } from './jobs/AttachmentBackupManager';
export function isOverHourIntoPast(timestamp: number): boolean {
return isNumber(timestamp) && isOlderThan(timestamp, HOUR);
@ -831,9 +832,10 @@ export async function startApp(): Promise<void> {
'background/shutdown: waiting for all attachment downloads to finish'
);
// Since we canceled the inflight requests earlier in shutdown, this should
// Since we canceled the inflight requests earlier in shutdown, these should
// resolve quickly
await AttachmentDownloadManager.stop();
await AttachmentBackupManager.stop();
log.info('background/shutdown: closing the database');
@ -1588,6 +1590,7 @@ export async function startApp(): Promise<void> {
drop(challengeHandler?.onOffline());
drop(AttachmentDownloadManager.stop());
drop(AttachmentBackupManager.stop());
drop(messageReceiver?.drain());
if (hasAppEverBeenRegistered) {
@ -1725,6 +1728,7 @@ export async function startApp(): Promise<void> {
if (isBackupEnabled()) {
backupsService.start();
drop(AttachmentBackupManager.start());
}
if (connectCount === 0) {