AWS Worker层cron - 服务器错误#500 - “发布http 1.1 500 AWS aws-sqsd / 2.0”

时间:2016-01-16 18:16:31

标签: django http amazon-web-services cron elastic-beanstalk

我正在尝试在Elastic Beanstalk上设置一个cronjob。任务正在安排中。出于测试目的,它应该每分钟运行一次......但它不起作用。这是一个Django应用程序。该应用程序在两个环境中运行,一个是工作者,另一个是“托管”应用程序。

这部分正在运作。该命令正在运行但尚未执行(文件未被删除)。

这是 views.py

@login_required def delete_expired_files(request): users = DemoUser.objects.all() for user in users: documents = Document.objects.filter(owner=user.id) if documents: for doc in documents: now = timezone.now() if now >= doc.date_published + timedelta(days = doc.owner.group.valid_time): doc.delete() return redirect("user_home")

cron.yml:

version: 1
cron:
    - name: "delete_expired_files"         
url: "http://networksapp.elasticbeanstalk.com/networks_app/delete_expired_files"
schedule: "* * * * *"    

但是,它会在access_log部分的日志文件中打印出来: "POST /myapp/management/commands/delete_expired_files HTTP/1.1" 500 124709 "-" "aws-sqsd/2.0"

这是我目前访问的日志文件: Log file content

为什么?我该如何解决? 非常感谢你。

0 个答案:

没有答案