Skip to content

Commit

Permalink
sync futures more
Browse files Browse the repository at this point in the history
  • Loading branch information
r0fls committed Jul 25, 2024
1 parent 122e873 commit 2d7dcca
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from ui.app import create_app
from utils.config import parse_config, initialize_brokers, initialize_strategies
from utils.logger import logger # Import the logger
from utils.utils import is_market_open
from utils.utils import is_market_open, is_futures_market_open
from data.sync_worker import sync_worker # Import the sync worker

SYNC_WORKER_INTERVAL_SECONDS = 60 * 5
Expand Down Expand Up @@ -173,6 +173,8 @@ async def start_sync_worker(config_path):
logger.info('Sync worker started successfully')
if is_market_open():
await asyncio.sleep(SYNC_WORKER_INTERVAL_SECONDS)
elif config.get('futures_enabled', False) and is_futures_market_open():
await asyncio.sleep(SYNC_WORKER_INTERVAL_SECONDS)
else:
logger.info('Market is closed, sleeping for 30 minutes')
await asyncio.sleep(60 * 30)
Expand Down

0 comments on commit 2d7dcca

Please sign in to comment.