我正在努力让一个cron的工作,并得到一个500错误。你知道吗
我的附录yaml文件包含以下处理程序,因此它将获取代码
- url: /.*
script: main.application
这是我的克朗.亚马尔你知道吗
cron:
- description: my cron job
url: /daily_batch
schedule: every 10 minutes
在主.py包含以下内容:
application = webapp2.WSGIApplication([
('/', MainPage),
('/daily_batch',DailyBatch),
], debug=True)
这就是我如何编写DailyBatch的代码
class DailyBatch ():
def get(self):
myDefaults = DefaultData.query().fetch()
for d in myDefaults:
counter = 0
如果我运行这个从一个网址,它工作正常,但给我一个500从cron错误。我在装傻。怎样?你知道吗
这是我得到的错误信息
ERROR 2015-12-28 10:57:20,056 webapp2.py:1552] this constructor takes no arguments
Traceback (most recent call last):
File "C:\Program Files (x86)\Google\google_appengine\lib\webapp2-2.5.2\webapp2.py", line 1535, in __call__
rv = self.handle_exception(request, response, e)
File "C:\Program Files (x86)\Google\google_appengine\lib\webapp2-2.5.2\webapp2.py", line 1529, in __call__
rv = self.router.dispatch(request, response)
File "C:\Program Files (x86)\Google\google_appengine\lib\webapp2-2.5.2\webapp2.py", line 1278, in default_dispatcher
return route.handler_adapter(request, response)
File "C:\Program Files (x86)\Google\google_appengine\lib\webapp2-2.5.2\webapp2.py", line 1101, in __call__
handler = self.handler(request, response)
TypeError: this constructor takes no arguments
INFO 2015-12-28 11:57:20,068 module.py:787] default: "GET /daily_batch HTTP/1.1" 500 1216
明白了。谢谢。更改为
相关问题 更多 >
编程相关推荐