Skip to content

Commit

Permalink
feat: implement batching messages further
Browse files Browse the repository at this point in the history
  • Loading branch information
Verisana committed Jan 5, 2023
1 parent b3fdf17 commit c2b85bd
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/stateful-event-subscriber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,9 @@ export abstract class StatefulEventSubscriber<State>
this.masterPoolNeeded &&
state === null
) {
this.logger.info(
`${this.parentName}: ${this.name}: schedule a job to get state from cache`,
this._logBatchTypicalMessages(
`${this.parentName}: schedule a job to get state from cache`,
'info',
);

this.dexHelper.cache.addBatchHGet(
Expand All @@ -384,8 +385,9 @@ export abstract class StatefulEventSubscriber<State>
return false;
}

this.logger.info(
`${this.parentName}: ${this.name}: received state from a scheduled job`,
this._logBatchTypicalMessages(
`${this.parentName}: received state from a scheduled job`,
'info',
);
this.setState(state.state, state.bn);
return true;
Expand All @@ -400,7 +402,11 @@ export abstract class StatefulEventSubscriber<State>
return;
}

this.logger.info(`${this.parentName}: ${this.name} saving state in cache`);
this._logBatchTypicalMessages(
`${this.parentName}: saving state in cache`,
'info',
);

this.dexHelper.cache.hset(
this.mapKey,
this.name,
Expand Down

0 comments on commit c2b85bd

Please sign in to comment.