Page MenuHomePhabricator

D7174.diff
No OneTemporary

D7174.diff

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 in the keyserver's timezone
async () => {
try {
// Do everything one at a time to reduce load since we're in no hurry,
@@ -63,7 +63,7 @@
},
);
schedule.scheduleJob(
- '0 3 ? * 0', // every Sunday at 3:00 AM GMT
+ '0 3 ? * 0', // every Sunday at 3:00 AM in the keyserver's timezone
async () => {
try {
await updateAndReloadGeoipDB();
@@ -76,7 +76,7 @@
},
);
schedule.scheduleJob(
- '0 0 * * *', // every day at midnight GMT
+ '0 0 * * *', // every day at midnight in the keyserver's timezone
async () => {
try {
if (process.env.RUN_COMM_TEAM_DEV_SCRIPTS) {
@@ -92,7 +92,7 @@
},
);
schedule.scheduleJob(
- '0 5 * * *', // every day at 5:00 AM GMT
+ '0 5 * * *', // every day at 5:00 AM in the keyserver's timezone
async () => {
try {
await compareMySQLUsersToIdentityService();
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),

File Metadata

Mime Type
text/plain
Expires
Thu, Nov 28, 3:53 AM (19 h, 8 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2592683
Default Alt Text
D7174.diff (2 KB)

Event Timeline