From 8572a7a387fba18576b885d85ca0b31bc4ad8ab9 Mon Sep 17 00:00:00 2001 From: "Vasily.onl" Date: Fri, 6 Jun 2025 12:07:27 +0800 Subject: [PATCH] fixed 'store_raw_data' --- config/data_collection.json | 2 +- config/okx_config.json | 2 +- data/exchanges/okx/collector.py | 13 +++++++------ 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/config/data_collection.json b/config/data_collection.json index 76a8600..2984fcd 100644 --- a/config/data_collection.json +++ b/config/data_collection.json @@ -9,7 +9,7 @@ "reconnect_delay": 5.0 }, "data_collection": { - "store_raw_data": true, + "store_raw_data": false, "health_check_interval": 120.0, "auto_restart": true, "buffer_size": 1000 diff --git a/config/okx_config.json b/config/okx_config.json index 056bed3..f631a3b 100644 --- a/config/okx_config.json +++ b/config/okx_config.json @@ -51,7 +51,7 @@ }, "database": { "store_processed_data": true, - "store_raw_data": true, + "store_raw_data": false, "force_update_candles": false, "batch_size": 100, "flush_interval": 5.0 diff --git a/data/exchanges/okx/collector.py b/data/exchanges/okx/collector.py index e6746d3..3d87730 100644 --- a/data/exchanges/okx/collector.py +++ b/data/exchanges/okx/collector.py @@ -327,12 +327,13 @@ class OKXCollector(BaseDataCollector): self.logger.warning(f"{self.component_name}: Message processing warnings: {errors}") # Store raw data if enabled (for debugging/compliance) - if self.store_raw_data and 'data' in message and 'arg' in message: - await self._store_raw_data(message['arg'].get('channel', 'unknown'), message) - - # Store processed market data points in raw_trades table - for data_point in market_data_points: - await self._store_processed_data(data_point) + if self.store_raw_data: + if 'data' in message and 'arg' in message: + await self._store_raw_data(message['arg'].get('channel', 'unknown'), message) + + # Store processed market data points in raw_trades table + for data_point in market_data_points: + await self._store_processed_data(data_point) # Return the first data point for compatibility (most use cases have single data point per message) return market_data_points[0] if market_data_points else None