Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3398151
D9201.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D9201.diff
View Options
diff --git a/keyserver/src/push/send.js b/keyserver/src/push/send.js
--- a/keyserver/src/push/send.js
+++ b/keyserver/src/push/send.js
@@ -148,15 +148,7 @@
}
}
- const cleanUpPromises = [];
- if (dbIDs.length > 0) {
- const query = SQL`DELETE FROM ids WHERE id IN (${dbIDs})`;
- cleanUpPromises.push(dbQuery(query));
- }
- const [deliveryResults] = await Promise.all([
- Promise.all(deliveryPromises),
- Promise.all(cleanUpPromises),
- ]);
+ const deliveryResults = await Promise.all(deliveryPromises);
const flattenedDeliveryResults = [];
for (const innerDeliveryResults of deliveryResults) {
@@ -168,7 +160,18 @@
}
}
- await saveNotifResults(flattenedDeliveryResults, notifications, true);
+ const cleanUpPromise = (async () => {
+ if (dbIDs.length === 0) {
+ return;
+ }
+ const query = SQL`DELETE FROM ids WHERE id IN (${dbIDs})`;
+ await dbQuery(query);
+ })();
+
+ await Promise.all([
+ cleanUpPromise,
+ saveNotifResults(flattenedDeliveryResults, notifications, true),
+ ]);
}
async function sendPushNotif(input: {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Dec 2, 9:18 PM (18 h, 27 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2608962
Default Alt Text
D9201.diff (1 KB)
Attached To
Mode
D9201: [keyserver] Don't send empty ID cleanup query in notifs code
Attached
Detach File
Event Timeline
Log In to Comment