定时调外部任务开启api

This commit is contained in:
mark.tian
2025-12-09 15:16:37 +08:00
parent 1556b5a586
commit c83db9b0da
24 changed files with 1178 additions and 2 deletions

25
run_flower.py Normal file
View File

@@ -0,0 +1,25 @@
#!/usr/bin/env python3
"""启动Flower监控服务"""
from celery import Celery
from flower import command as flower_command
def start_flower():
"""启动Flower监控"""
print("启动Flower监控服务...")
print("监控地址: http://localhost:5555")
print("按 Ctrl+C 停止服务")
# Flower配置
flower_options = {
'broker': 'redis://localhost:6379/0',
'port': 5555,
'basic_auth': None, # 可以设置用户名:密码,如 'admin:password'
'inspect_timeout': 1000,
'purge_offline_workers': 60,
}
# 启动Flower
flower_command.flower_command(flower_options)
if __name__ == '__main__':
start_flower()