Files
Sipro-Stocks/background/tasks.py
2024-07-02 08:55:24 +03:00

13 lines
311 B
Python

import asyncio
from asgiref.sync import async_to_sync
from background import celery
import background.update
@celery.task(name='process_update')
def process_update(product_ids: list[int]):
loop = asyncio.get_event_loop()
return loop.run_until_complete(background.update.process_update(product_ids))