Improve Processing of Sync Tasks

This commit is contained in:
yash-signal
2025-02-25 09:18:42 -06:00
committed by GitHub
parent b3805f1427
commit 0f767c0098
8 changed files with 323 additions and 24 deletions

View File

@@ -0,0 +1,29 @@
// Copyright 2025 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type { Database } from '@signalapp/better-sqlite3';
import type { LoggerType } from '../../types/Logging';
import { sql } from '../util';
export const version = 1330;
export function updateToSchemaVersion1330(
currentVersion: number,
db: Database,
logger: LoggerType
): void {
if (currentVersion >= 1330) {
return;
}
db.transaction(() => {
const [query] = sql`
CREATE INDEX syncTasks_type ON syncTasks (type);
`;
db.exec(query);
db.pragma('user_version = 1330');
})();
logger.info('updateToSchemaVersion1330: success!');
}

View File

@@ -108,10 +108,12 @@ import { updateToSchemaVersion1280 } from './1280-blob-unprocessed';
import { updateToSchemaVersion1290 } from './1290-int-unprocessed-source-device';
import { updateToSchemaVersion1300 } from './1300-sticker-pack-refs';
import { updateToSchemaVersion1310 } from './1310-muted-fixup';
import { updateToSchemaVersion1320 } from './1320-unprocessed-received-at-date';
import {
updateToSchemaVersion1320,
updateToSchemaVersion1330,
version as MAX_VERSION,
} from './1320-unprocessed-received-at-date';
} from './1330-sync-tasks-type-index';
import { DataWriter } from '../Server';
function updateToSchemaVersion1(
@@ -2091,6 +2093,7 @@ export const SCHEMA_VERSIONS = [
updateToSchemaVersion1300,
updateToSchemaVersion1310,
updateToSchemaVersion1320,
updateToSchemaVersion1330,
];
export class DBVersionFromFutureError extends Error {