mirror of
https://github.com/fastapi-practices/fastapi_best_architecture.git
synced 2025-08-18 06:42:51 +08:00

* Replace APScheduler to Celery task * black format * Add celery to run the script * Update celery usage to README * Update test task * Add celery rabbitmq broker * Fix dockerfiles * Add task interface access authorization * Update celery deploy run * Fix dockerfiles * Fix supervisor conf * Update celery broker default is redis * Force the pro env to use rabbitmq * Update the task interface * Add celery beat README description * Update warning text style * Revoke the default config comment content of the supervisor
16 lines
296 B
Python
16 lines
296 B
Python
#!/usr/bin/env python3
|
|
# -*- coding: utf-8 -*-
|
|
import uuid
|
|
import sys
|
|
|
|
sys.path.append('../../')
|
|
|
|
from backend.app.core.celery import celery_app # noqa: E402
|
|
|
|
|
|
@celery_app.task
|
|
def task_demo_async() -> str:
|
|
uid = uuid.uuid4().hex
|
|
print(f'异步任务 {uid} 执行成功')
|
|
return uid
|