Skip to content

Commit

Permalink
check connection preloads keys module for reliable measurement
Browse files Browse the repository at this point in the history
  • Loading branch information
woodser committed Sep 7, 2023
1 parent 6874b02 commit 6f3d68c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/main/js/common/MoneroRpcConnection.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,11 @@ class MoneroRpcConnection {
/**
* Check the connection status to update isOnline, isAuthenticated, and response time.
*
* @param {int} timeoutInMs - maximum response time before considered offline
* @param {int} timeoutMs - maximum response time before considered offline
* @return {Promise<boolean>} true if there is a change in status, false otherwise
*/
async checkConnection(timeoutInMs) {
async checkConnection(timeoutMs) {
await LibraryUtils.loadKeysModule(); // cache wasm for binary request
let isOnlineBefore = this._isOnline;
let isAuthenticatedBefore = this._isAuthenticated;
let startTime = Date.now();
Expand Down
2 changes: 1 addition & 1 deletion src/test/utils/TestUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ TestUtils.WALLET_TX_TRACKER = new WalletTxTracker(); // used to track wallet txs
TestUtils.PROXY_TO_WORKER = true;
TestUtils.SYNC_PERIOD_IN_MS = 5000; // period between wallet syncs in milliseconds
TestUtils.OFFLINE_SERVER_URI = "offline_server_uri"; // dummy server uri to remain offline because wallet2 connects to default if not given
TestUtils.AUTO_CONNECT_TIMEOUT_MS = 1000;
TestUtils.AUTO_CONNECT_TIMEOUT_MS = 2000;

// monero-wallet-rpc process management
TestUtils.WALLET_RPC_PORT_START = 28084;
Expand Down

0 comments on commit 6f3d68c

Please sign in to comment.