@@ -36,7 +36,7 @@ elif environment == 'test': | |||
scheduled_task_add_contacts_from_chatrooms_interval = 60*11 | |||
else: | |||
scheduled_task_sync_wx_info_interval = 6000 | |||
scheduled_task_add_contacts_from_chatrooms_interval=60 | |||
scheduled_task_add_contacts_from_chatrooms_interval=6 | |||
# 定义定时任务列表 (任务 ID, 任务名称, 执行间隔秒, 任务参数) | |||
@@ -39,7 +39,7 @@ if __name__ == "__main__": | |||
celery_beat_process = start_celery_beat() | |||
# 等待子进程完成 | |||
#fastapi_process.wait() | |||
fastapi_process.wait() | |||
celery_worker_process.wait() | |||
celery_beat_process.wait() | |||
@@ -15,8 +15,11 @@ import asyncio,random | |||
from model.models import AddGroupContactsHistory | |||
@celery_app.task(name='tasks.add_task', bind=True, acks_late=True) | |||
def add_task(self, x, y): | |||
time.sleep(5) # 模拟长时间计算 | |||
logger.info('add') | |||
return x + y | |||