Google App Engine Python Cron
几天来我一直在尝试让 Google App Engine 运行一个 cron Python 脚本,该脚本将简单地执行托管在我的服务器上的脚本。
它不需要将任何数据发布到页面,只需打开一个连接,等待它完成然后给我发电子邮件。
我之前编写的代码已记录为“成功”,但我从未收到电子邮件,也没有看到我添加的任何用于测试的 logging.info
代码。
有想法吗?
我最初编写的原始代码和错误代码可以在找到 Google AppEngine Python Cron job urllib - 只是让你知道我以前尝试过这个。
I've been trying for a few days now to get Google App Engine to run a cron Python script which will simply execute a script hosted on a server of mine.
It doesn't need to post any data to the page, simply open a connection, wait for it to finish then email me.
The code I've previously written has logged as "successful" but I never got an email, nor did I see any of the logging.info
code I added to test things.
Ideas?
The original and wrong code that I originally wrote can be found at Google AppEngine Python Cron job urllib - just so you know I have attempted this before.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这里发生了各种奇怪的事情。
首先,
app.yaml
我必须在设置根之前放置我的/cron
处理程序:否则我会遇到无法找到该文件的疯狂错误。这一点确实有道理。
接下来是 Python 代码。不知道这里发生了什么,但最终我设法通过这样做让它工作:
无论是什么导致了问题,现在都已修复。
Mix of weird things was happening here.
Firstly,
app.yaml
I had to place my/cron
handler before the root was set:Otherwise I'd get crazy errors about not being able to find the file. That bit actually makes sense.
The next bit was the Python code. Not sure what was going on here, but in the end I managed to get it working by doing this:
Whatever it was causing the problems, it's now fixed.