Pause, cancel & resume backup media download

This commit is contained in:
trevor-signal 2024-09-16 15:38:12 -04:00 committed by GitHub
parent 65539b1419
commit 028a3f3ef0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
28 changed files with 958 additions and 141 deletions

View file

@ -0,0 +1,29 @@
// Copyright 2024 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type { Database } from '@signalapp/better-sqlite3';
import type { LoggerType } from '../../types/Logging';
export const version = 1200;
export function updateToSchemaVersion1200(
currentVersion: number,
db: Database,
logger: LoggerType
): void {
if (currentVersion >= 1200) {
return;
}
db.transaction(() => {
// The standard getNextAttachmentDownloadJobs query uses active & source conditions,
// ordered by received_at
db.exec(`
CREATE INDEX attachment_downloads_active_source_receivedAt
ON attachment_downloads (
active, source, receivedAt
);
`);
db.pragma('user_version = 1200');
})();
logger.info('updateToSchemaVersion1200: success!');
}