Fixed issue causing startup of various components to be delayed by 30 seconds.

This commit is contained in:
CalDescent 2022-09-25 18:39:56 +01:00
parent 1bb8f1b6d2
commit a9721bab3d

View File

@ -133,17 +133,10 @@ public class OnlineAccountsManager {
// Process import queue
executor.scheduleWithFixedDelay(this::processOnlineAccountsImportQueue, ONLINE_ACCOUNTS_QUEUE_INTERVAL, ONLINE_ACCOUNTS_QUEUE_INTERVAL, TimeUnit.MILLISECONDS);
// Sleep for some time before scheduling sendOurOnlineAccountsInfo()
// Send our online accounts (using increased initial delay)
// This allows some time for initial online account lists to be retrieved, and
// reduces the chances of the same nonce being computed twice
try {
Thread.sleep(INITIAL_SLEEP_INTERVAL);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
// Send our online accounts
executor.scheduleAtFixedRate(this::sendOurOnlineAccountsInfo, ONLINE_ACCOUNTS_COMPUTE_INTERVAL, ONLINE_ACCOUNTS_COMPUTE_INTERVAL, TimeUnit.MILLISECONDS);
executor.scheduleAtFixedRate(this::sendOurOnlineAccountsInfo, INITIAL_SLEEP_INTERVAL, ONLINE_ACCOUNTS_COMPUTE_INTERVAL, TimeUnit.MILLISECONDS);
}
public void shutdown() {