Coverage for src / utils / update.py: 0%
13 statements
« prev ^ index » next coverage.py v7.13.4, created at 2026-03-01 10:28 +0000
« prev ^ index » next coverage.py v7.13.4, created at 2026-03-01 10:28 +0000
1import asyncio
2import logging
4from src.utils import store_util
6SERVER_MODE_INTERVAL_IN_MINUTES = 30
9async def async_update_task():
10 """ async function"""
11 while True:
12 store_util.update_data(battle_update=True, season_update=True)
13 logging.info("Update task done wait for: " + str(SERVER_MODE_INTERVAL_IN_MINUTES) + " minutes")
14 await asyncio.sleep(SERVER_MODE_INTERVAL_IN_MINUTES*60)
17async def async_background_task():
18 """Main async function"""
19 await asyncio.gather(async_update_task())
22def async_background_task_wrapper():
23 """Not async Wrapper around async_main to run it as target function of Thread"""
24 asyncio.run(async_background_task())