Se agregaron los moduloes de api_v2
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
from celery import Celery
|
||||
from celery_app import celery_app
|
||||
import asyncio
|
||||
import logging
|
||||
from typing import Dict, Any
|
||||
from contextlib import asynccontextmanager
|
||||
|
||||
|
||||
def run_async_task(async_func, *args, **kwargs):
|
||||
"""Helper function to run async functions in Celery tasks"""
|
||||
loop = asyncio.new_event_loop()
|
||||
asyncio.set_event_loop(loop)
|
||||
try:
|
||||
return loop.run_until_complete(async_func(*args, **kwargs))
|
||||
finally:
|
||||
loop.close()
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user