python - Google App Engine deferred.defer() error 404 -


i'm trying running task in task queue using deferred.defer(). task added default task queue, task fail 404 error.

this handler:

import webapp2 import models  import defer_ajust_utils  google.appengine.ext import ndb google.appengine.ext import deferred  class ajust_utils(webapp2.requesthandler):   def get(self):     deferred.defer(defer_ajust_utils.dothejob)  application = webapp2.wsgiapplication([('/ajust_utils', ajust_utils)], debug=true) 

this module defer_ajust_utils :

import logging import models  google.appengine.ext import ndb  def dothejob():   logging.info("debut de la mise jour des utilisateurs")   utilisateurs = models.utilisateur.query()   utilisateurs = utilisateurs.fetch()    utilisateur in utilisateurs:     utilisateur.produire_factures_i = false     utilisateur.put()      logging.info("fin de la mise jour des utilisateurs") 

and app.yaml file :

application: xxxx version: dev runtime: python27 api_version: 1 threadsafe: yes  builtins: - deferred: on  handlers: - url: /ajust_utils   script : tempo_ajuster_utils.application   login: admin 

here's log :

0.1.0.2 - - [10/mar/2014:17:50:45 -0700] "post /_ah/queue/deferred http/1.1" 404 113 "http://xxxx.appspot.com/ajust_utils" "appengine-google; (+http://code.google.com/appengine)" "xxxx.appspot.com" ms=6 cpu_ms=0  cpm_usd=0.000013 queue_name=default task_name=17914595085560382799  app_engine_release=1.9.0 instance=00c61b117c0b3648693af0563b92051423b3cb 

thank help!!

if using push-to-deploy git, when add in 'builtin' part app.yaml, such in

builtins: - deferred: on

you need 'normal' gcloud deploy before run app. otherwise not update running app, causes 404 errors /_ah/queue/deferred

there open bug this, vote , may fixed. https://code.google.com/p/googleappengine/issues/detail?id=10139


Comments

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -