Skip to content

Commit

Permalink
chore(cardano-services): avoid MISSING PREPARED STATEMENT log messages
Browse files Browse the repository at this point in the history
  • Loading branch information
mirceahasegan committed May 7, 2024
1 parent afea738 commit c15f308
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,10 @@ export class StakePoolBuilder {

public async getLastEpoch() {
this.#logger.debug('About to query last epoch');
const result: QueryResult<EpochModel> = await this.#db.query(Queries.findLastEpoch);
const result: QueryResult<EpochModel> = await this.#db.query({
name: 'current_epoch',
text: findLastEpoch
});
const lastEpoch = result.rows[0];
if (!lastEpoch) throw new ProviderError(ProviderFailure.Unknown, null, "Couldn't find last epoch");
return lastEpoch.no;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ export class DbSyncEpochPollService implements EpochMonitor {
* @returns {number} epoch number
*/
async #queryLastEpoch() {
const result: QueryResult<EpochModel> = await this.#db.query(findLastEpoch);
const result: QueryResult<EpochModel> = await this.#db.query({
name: 'current_epoch',
text: findLastEpoch
});
return Cardano.EpochNo(result.rows[0].no);
}

Expand Down

0 comments on commit c15f308

Please sign in to comment.