You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Celery定时邮件任务每次触发重复执行两次问题求助(SendGrid+Heroku)

Celery定时任务重复发送邮件问题

我有一个用于发送邮件的Celery定时任务,近期开始出现同一主题和内容的邮件被接收两次的情况。相关环境与信息如下:

  • 使用SendGrid作为邮件发送服务
  • 应用部署在Heroku服务器上

以下是运行该任务的代码片段:

app.config_from_object('django.conf:settings', namespace='CELERY')
app.conf.broker_transport_options = {'visibility_timeout': 43200}

"send_sales_ga_rental":{
    "task": "core.tasks.send_sales_ga_rental",
    'schedule': crontab(0, hour=12, day_of_week='1')        
}

app.autodiscover_tasks()

@app.task(bind=True)
def debug_task(self):
    print(f'Request: {self.request!r}')

附任务执行日志截图:
Celery任务重复执行日志

内容的提问来源于stack exchange,提问作者Yoseph_Reyes

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.19 00:59:53