diff --git a/keyserver/src/cron/cron.js b/keyserver/src/cron/cron.js --- a/keyserver/src/cron/cron.js +++ b/keyserver/src/cron/cron.js @@ -27,7 +27,7 @@ if (cluster.isMaster) { schedule.scheduleJob( - '30 3 * * *', // every day at 3:30 AM Pacific Time + '30 3 * * *', // every day at 3:30 AM GMT async () => { try { // Do everything one at a time to reduce load since we're in no hurry, diff --git a/keyserver/src/database/migration-config.js b/keyserver/src/database/migration-config.js --- a/keyserver/src/database/migration-config.js +++ b/keyserver/src/database/migration-config.js @@ -216,6 +216,17 @@ `); }, ], + [ + 21, + async () => { + await dbQuery(SQL` + ALTER TABLE reports + DROP INDEX IF EXISTS user, + ADD INDEX IF NOT EXISTS user_type_platform_creation_time + (user, type, platform, creation_time); + `); + }, + ], ]); const newDatabaseVersion: number = Math.max(...migrations.keys()); diff --git a/keyserver/src/database/setup-db.js b/keyserver/src/database/setup-db.js --- a/keyserver/src/database/setup-db.js +++ b/keyserver/src/database/setup-db.js @@ -292,7 +292,9 @@ ALTER TABLE notifications ADD INDEX user (user); ALTER TABLE reports - ADD PRIMARY KEY (id); + ADD PRIMARY KEY (id), + ADD INDEX user_type_platform_creation_time + (user, type, platform, creation_time); ALTER TABLE revisions ADD PRIMARY KEY (id),