mirror of
https://github.com/fastapi-practices/fastapi-best-architecture.git
synced 2026-09-21 21:15:13 +00:00
Add support for celery dynamic tasks (#715)
* Add support for celery dynamic tasks * Update the celery conf * Update the celery task tables name * Refactor the celery task-related interfaces * Optimize auto-discovery tasks * Remove redundant config * Refine the business codes * Optimize crontab validation returns * Update dependencies in pyproject toml * Fix some bugs * Update dependencies * Update the version to 1.7.0 * Fix update and delete event
This commit is contained in:
@@ -13,21 +13,16 @@ from sqlalchemy.ext.asyncio import async_engine_from_config
|
||||
|
||||
sys.path.append('../')
|
||||
|
||||
from backend.app import get_app_models
|
||||
from backend.common.model import MappedBase
|
||||
from backend.core import path_conf
|
||||
from backend.database.db import SQLALCHEMY_DATABASE_URL
|
||||
from backend.plugin.tools import get_plugin_models
|
||||
|
||||
# import your new model here
|
||||
from backend.app.admin.model import * # noqa: F401
|
||||
from backend.plugin.code_generator.model import * # noqa: F401
|
||||
|
||||
# import plugin model
|
||||
for cls in get_plugin_models():
|
||||
# import models
|
||||
for cls in get_app_models() + get_plugin_models():
|
||||
class_name = cls.__name__
|
||||
if class_name in globals():
|
||||
print(f'\nWarning: Class "{class_name}" already exists in global namespace.')
|
||||
else:
|
||||
if class_name not in globals():
|
||||
globals()[class_name] = cls
|
||||
|
||||
if not os.path.exists(path_conf.ALEMBIC_VERSION_DIR):
|
||||
|
||||
Reference in New Issue
Block a user