Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion deploy/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 8 additions & 8 deletions market-data/src/websocket/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down
Loading