From b2b2b808cd4bb43ca6063b609b0e079a57400891 Mon Sep 17 00:00:00 2001 From: Davi Samora Date: Fri, 19 Dec 2025 13:25:13 -0300 Subject: [PATCH 1/2] Fix strategy service startup: add PYTHONPATH environment variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The strategy service was failing to start (exit status 3) because Python couldn't find the strategy module. This fix: - Adds PYTHONPATH=/app to the main Dockerfile - Adds PYTHONPATH to supervisord.conf environment for strategy service This ensures the Python import path includes /app so that "strategy.src.api.main" can be resolved correctly. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- Dockerfile | 3 +++ deploy/supervisord.conf | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index aea7f00..b8014a8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -117,6 +117,9 @@ COPY --from=python-builder /usr/local/lib/python3.11/site-packages /usr/local/li COPY strategy/__init__.py /app/strategy/__init__.py COPY strategy/src /app/strategy/src +# Set PYTHONPATH for strategy module imports +ENV PYTHONPATH=/app + # Copy supervisor configuration COPY deploy/supervisord.conf /etc/supervisor/conf.d/supervisord.conf diff --git a/deploy/supervisord.conf b/deploy/supervisord.conf index 1c66ae6..82e0a9d 100644 --- a/deploy/supervisord.conf +++ b/deploy/supervisord.conf @@ -34,7 +34,7 @@ autostart=true autorestart=true stderr_logfile=/var/log/supervisor/strategy.err.log stdout_logfile=/var/log/supervisor/strategy.out.log -environment=DATABASE_URL="%(ENV_DATABASE_URL)s",TIMEZONE="%(ENV_TIMEZONE)s" +environment=DATABASE_URL="%(ENV_DATABASE_URL)s",TIMEZONE="%(ENV_TIMEZONE)s",PYTHONPATH="/app" priority=300 startsecs=10 startretries=3 From 203696b4ba1d30b326db7beaa1da586375b87d37 Mon Sep 17 00:00:00 2001 From: Davi Samora Date: Fri, 19 Dec 2025 13:32:46 -0300 Subject: [PATCH 2/2] Fix clippy collapsible_if warning in WebSocketManager MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Collapse nested if statements for reconnect counter reset logic to satisfy clippy's collapsible_if lint. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- market-data/src/websocket/manager.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/market-data/src/websocket/manager.rs b/market-data/src/websocket/manager.rs index 2749654..fee5555 100644 --- a/market-data/src/websocket/manager.rs +++ b/market-data/src/websocket/manager.rs @@ -45,14 +45,14 @@ impl WebSocketManager { loop { // Reset reconnect attempts if we've been stable for a while if let Some(last_success) = self.last_successful_connection { - if last_success.elapsed() > Duration::from_secs(RECONNECT_COOLDOWN_SECS) { - if self.reconnect_attempts > 0 { - info!( - previous_attempts = self.reconnect_attempts, - "Resetting reconnect counter after cooldown period" - ); - self.reconnect_attempts = 0; - } + if last_success.elapsed() > Duration::from_secs(RECONNECT_COOLDOWN_SECS) + && self.reconnect_attempts > 0 + { + info!( + previous_attempts = self.reconnect_attempts, + "Resetting reconnect counter after cooldown period" + ); + self.reconnect_attempts = 0; } }