123
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
import json
|
||||
import asyncio
|
||||
|
||||
from asgiref.sync import async_to_sync
|
||||
|
||||
from background import celery
|
||||
import background.update
|
||||
|
||||
|
||||
@celery.task(name='test')
|
||||
def test_task():
|
||||
with open('test.json', 'a') as tf:
|
||||
tf.write(json.dumps({'ok': True}))
|
||||
@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))
|
||||
|
||||
Reference in New Issue
Block a user