refactor: see details below

- Fix emailing.
- Updated manage.sh to enhance command handling and service management for backend and frontend.
- Introduced utility functions for better code organization and readability.
- Added support for checking Node.js version and ensuring the virtual environment is set up.
- Implemented improved logging with color-coded output for better visibility.
- Created a new nginx.conf.example file for easy Nginx configuration setup for the application.
This commit is contained in:
2026-01-02 01:57:25 +08:00
parent fdc725b893
commit 5430dc03f4
15 changed files with 1257 additions and 2023 deletions
+4 -3
View File
@@ -336,9 +336,10 @@ class TaskService:
job_id = f"task_{task.id}"
# 先移除旧的任务(如果存在)
if scheduler.get_job(job_id):
existing_job = scheduler.get_job(job_id)
if existing_job:
scheduler.remove_job(job_id)
logger.debug(f"从调度器移除旧任务: {job_id}")
logger.info(f"从调度器移除旧任务: {job_id}")
# 如果任务启用且有有效的 cron 表达式,添加新任务
if task.is_scheduled_enabled:
@@ -354,7 +355,7 @@ class TaskService:
args=[task.id],
replace_existing=True
)
logger.info(f"✅ 任务 {task.id}添加到调度器: {cron_str}")
logger.info(f"✅ 任务 {task.id}重新加载到调度器: {cron_str}")
else:
logger.warning(f"任务 {task.id} 的 cron 表达式无效: {cron_str}")
else: