Skip to content

Commit

Permalink
watcher: handle near missing blocks
Browse files Browse the repository at this point in the history
Apparently, the winston loki logger doesn't like when you add a variable in log message (comma separated). It seems to ignore the variable.
  • Loading branch information
panoel committed Oct 31, 2023
1 parent ba00fc7 commit 2e86fa3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions watcher/src/watchers/NearArchiveWatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class NearArchiveWatcher extends Watcher {
console.log('getFinalizedBlockNumber', block.header.height);
return block.header.height;
} catch (e) {
this.logger.error('getFinalizedBlockNumber(): Error fetching block', e);
this.logger.error(`getFinalizedBlockNumber(): Error fetching block: ${e}`);
throw e;
}
}
Expand All @@ -52,7 +52,7 @@ export class NearArchiveWatcher extends Watcher {
} catch (e) {
// Logging this to help with troubleshooting.
this.logger.debug(e);
this.logger.error('getMessagesForBlocks(): Error fetching from block', fromBlock);
this.logger.error(`getMessagesForBlocks(): Error fetching from block ${fromBlock}`);
fromBlock++;
if (fromBlock > toBlock) {
this.logger.error(
Expand All @@ -77,7 +77,7 @@ export class NearArchiveWatcher extends Watcher {
} catch (e) {
// Logging this to help with troubleshooting.
this.logger.debug(e);
this.logger.error('getMessagesForBlocks(): Error fetching toBlock', toBlock);
this.logger.error(`getMessagesForBlocks(): Error fetching toBlock ${toBlock}`);
toBlock--;
if (toBlock < fromBlock) {
this.logger.error(
Expand Down

0 comments on commit 2e86fa3

Please sign in to comment.