Skip to content

Commit

Permalink
[keyserver] convert secondary migration block from do while to regula…
Browse files Browse the repository at this point in the history
…r while loop

Summary: The `do-while` ensures an unnecessary 5 second sleep time. Converting this to a `while` loop ensures this only happens if necessary

Test Plan: flow check

Reviewers: ashoat

Reviewed By: ashoat

Subscribers: tomek

Differential Revision: https://phab.comm.dev/D13273
  • Loading branch information
wyilio committed Sep 11, 2024
1 parent fc609bd commit 7488a4e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions keyserver/src/keyserver.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,12 +238,12 @@ void (async () => {
server.listen(parseInt(process.env.PORT, 10) || 3000, listenAddress);

if (isSecondaryNode) {
let dbVersion;
do {
let dbVersion = await fetchDBVersion();
while (dbVersion < latestWrapInTransactionAndBlockRequestsVersion) {
await sleep(5000);

dbVersion = await fetchDBVersion();
} while (dbVersion < latestWrapInTransactionAndBlockRequestsVersion);
}
}

// Note - the order of router declarations matters. On prod we have
Expand Down

0 comments on commit 7488a4e

Please sign in to comment.