私の Web アプリでは、Google App Engine のデータストア内のデータにアクセスし、Web サイトを解析し、結果を電子メールで送信することになっているこの cron ジョブを作成しました。
ただし、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