|
- from app.celery_app import celery
- from fastapi import Request,FastAPI
- import time
-
- @celery.task(name='app.tasks.add_task', bind=True, acks_late=True)
- def add_task(self, x, y):
- time.sleep(5)
- return x + y
-
-
- @celery.task(name='app.tasks.mul_task', bind=True, acks_late=True)
- def mul_task(self, x, y):
- time.sleep(5)
- return x * y
-
-
-
-
-
-
-
-
-
- @celery.task(name='app.tasks.sync_contacts', bind=True, acks_late=True)
- async def sync_contacts_task(self, redis_service):
-
- login_keys = list(await redis_service.client.scan_iter(match='__AI_OPS_WX__:LOGININFO:*'))
- return login_keys
|