Skip to content

Commit

Permalink
Hide redundant logs for subscriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
Rexagon committed Apr 29, 2024
1 parent fc457d6 commit dd5b359
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "everscale-standalone-client",
"version": "2.1.24",
"version": "2.1.25",
"repository": "https://github.com/broxus/everscale-standalone-client",
"scripts": {
"build": "tsc",
Expand Down
10 changes: 5 additions & 5 deletions src/client/SubscriptionController/subscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export class ContractSubscription {
return this._contract.pollingMethod;
});
} catch (e: any) {
console.error(`Error during account refresh (${this._address})`, e);
debugLog(`Error during account refresh (${this._address})`, e);
}

debugLog('ContractSubscription -> manual -> refreshing ends');
Expand All @@ -132,21 +132,21 @@ export class ContractSubscription {

let nextBlockId: string;
if (this._currentBlockId == null) {
console.warn('Starting reliable connection with unknown block');
debugLog('ContractSubscription -> starting reliable connection with unknown block');

try {
const latestBlock = await connection.getLatestBlock(this._address);
this._currentBlockId = latestBlock.id;
nextBlockId = this._currentBlockId;
} catch (e: any) {
console.error(`Failed to get latest block for ${this._address}`, e);
debugLog(`Failed to get latest block for ${this._address}`, e);
continue;
}
} else {
try {
nextBlockId = await connection.waitForNextBlock(this._currentBlockId, this._address, NEXT_BLOCK_TIMEOUT);
} catch (e: any) {
console.error(`Failed to wait for next block for ${this._address}`);
debugLog(`Failed to wait for next block for ${this._address}`);
continue; // retry
}
}
Expand All @@ -158,7 +158,7 @@ export class ContractSubscription {
});
this._currentBlockId = nextBlockId;
} catch (e: any) {
console.error(`Failed to handle block for ${this._address}`, e);
debugLog(`Failed to handle block for ${this._address}`, e);
}
}
}
Expand Down

0 comments on commit dd5b359

Please sign in to comment.