Skip to content

Commit

Permalink
fix: Convert snapshot version to number in JS
Browse files Browse the repository at this point in the history
  • Loading branch information
fmarek-kindred committed Sep 13, 2023
1 parent 7de322d commit c2f0166
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cohort_banking_initiator_js/src/banking-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ export class BankingApp {
}

// Quickly grab the snapshot to check whether safepoint condition is satisfied. Any row can be used for that.
const snapshot = result.rows[0].snapshot
const snapshot = Number(result.rows[0].snapshot)
if (snapshot < request.safepoint) {
// safepoint condition
return 2
Expand Down
3 changes: 2 additions & 1 deletion cohort_banking_replicator_js/src/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ export class Database {

logger.warn("Database.getSnapshot(): %d", version)

return version
return Number(version)

} finally {
cnn?.release()
const metric = new MetricsSet()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ where
let mut statemap_installer_queue = StatemapInstallerQueue::default();

//Gets snapshot initial version from db.
statemap_installer_queue.update_snapshot(snapshot_api.get_snapshot().await.unwrap_or(0));
statemap_installer_queue.update_snapshot(snapshot_api.get_snapshot().await.unwrap());

// let mut last_item_send_for_install = 0;

Expand Down

0 comments on commit c2f0166

Please sign in to comment.