Coverage for src/utils/update.py: 0%

13 statements  

« prev     ^ index     » next       coverage.py v7.8.2, created at 2025-06-03 19:06 +0000

1import asyncio 

2import logging 

3 

4from src.utils import store_util 

5 

6SERVER_MODE_INTERVAL_IN_MINUTES = 30 

7 

8 

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) 

15 

16 

17async def async_background_task(): 

18 """Main async function""" 

19 await asyncio.gather(async_update_task()) 

20 

21 

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())