对于我的网络应用程序,我编写了这个 cron 作业,它应该访问 Google App Engine 的数据存储区中的数据,解析网站,然后通过电子邮件发送结果。
但是,404
在请求 cron 作业时出现错误,并且不知道如何解决此问题。这是我访问数据库的方式吗?
谢谢
这是我的update.py
:
from google.appengine.ext import db
import urllib2
import string
import myWebapp
## CRON 1:
## Check all x in B.db if courses changed
## Yes:
## email x
## if x.things all != 'Closed':
## remove from db
boo = myWebapp.B.all()
if boo.count() >0:
for b in boo.run(batch_size=1000):
currentThings = b.mThings
newThings = myWebapp.updateStatus(b.mThings)
if currentThings != newThings:
b.mThings = newThings
myWebapp.sendTextAndEmail(b.mEmail, b.mPhoneNumMail,
b.mThings, "myWebapp Update")
numClosed = 0
for c in b.mThings:
if c[2] == 'Closed':
numClosed += 1
if numClosed == 0:
b.delete()
这是我的 cron.yaml:
cron:
- description: check things and email if change
url: /.update.py
schedule: every 5 minutes
timezone: US/Pacific