From dc26c0fa0444e45d923d8f2ca2a673636b9cd751 Mon Sep 17 00:00:00 2001 From: Bogdan Crisan Date: Thu, 25 Jul 2024 12:53:46 +0200 Subject: [PATCH] Resolve PR comments --- doc/doc-site/docs/off-chain/dss/mqtt.md | 7 ++++++- ...n_version.sql => get_user_history_last_indexed_txn.sql} | 0 src/rust/mqtt-publisher/src/main.rs | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) rename src/rust/mqtt-publisher/sqlx_queries/{get_txn_version.sql => get_user_history_last_indexed_txn.sql} (100%) diff --git a/doc/doc-site/docs/off-chain/dss/mqtt.md b/doc/doc-site/docs/off-chain/dss/mqtt.md index fdc593c2..8f657c2b 100644 --- a/doc/doc-site/docs/off-chain/dss/mqtt.md +++ b/doc/doc-site/docs/off-chain/dss/mqtt.md @@ -45,10 +45,15 @@ A payload for this event looks like this: ```json { "price": 12345, - "size": 12345 + "size": 12345, + "txn_version": 12345 } ``` +*Remember to set `MQTT_PRICE_LEVELS=yes` in the `.env` file for docker compose +(if running with docker compose, otherwise the `mqtt-publisher` executable must +have that variable exported) if you wish to get price levels over MQTT.* + ### PlaceLimitOrderEvents `place_limit_order/MARKET_ID/USER_ADDRESS/CUSTODIAN_ID/INTEGRATOR` diff --git a/src/rust/mqtt-publisher/sqlx_queries/get_txn_version.sql b/src/rust/mqtt-publisher/sqlx_queries/get_user_history_last_indexed_txn.sql similarity index 100% rename from src/rust/mqtt-publisher/sqlx_queries/get_txn_version.sql rename to src/rust/mqtt-publisher/sqlx_queries/get_user_history_last_indexed_txn.sql diff --git a/src/rust/mqtt-publisher/src/main.rs b/src/rust/mqtt-publisher/src/main.rs index 76597d09..a0b83a39 100644 --- a/src/rust/mqtt-publisher/src/main.rs +++ b/src/rust/mqtt-publisher/src/main.rs @@ -150,7 +150,7 @@ async fn price_level_loop(db_url: &str, mqtt_client: Arc>) - let data = sqlx::query_file!("sqlx_queries/get_price_levels.sql") .fetch_all(&mut tx as &mut PgConnection) .await?; - let txn_version = sqlx::query_file!("sqlx_queries/get_txn_version.sql") + let txn_version = sqlx::query_file!("sqlx_queries/get_user_history_last_indexed_txn.sql") .fetch_one(&mut tx as &mut PgConnection) .await? .txn_version