Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cocoa/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google app engine 是否可以使用内置延迟处理程序在Google App Engine中调度cron任务?_Google App Engine_Cron - Fatal编程技术网

Google app engine 是否可以使用内置延迟处理程序在Google App Engine中调度cron任务?

Google app engine 是否可以使用内置延迟处理程序在Google App Engine中调度cron任务?,google-app-engine,cron,Google App Engine,Cron,我的app.yaml文件中有以下内容 builtins: - deferred: on handlers: - url: /_ah/queue/deferred.* script: google.appengine.ext.deferred.deferred.application login: admin 是否可以将google.appengine.ext.deferred.deferred.application作为cron作业来安排一些公开的任务?cron.yaml文件中的UR

我的app.yaml文件中有以下内容

builtins:
- deferred: on

handlers:
- url: /_ah/queue/deferred.*
  script: google.appengine.ext.deferred.deferred.application
  login: admin
是否可以将google.appengine.ext.deferred.deferred.application作为cron作业来安排一些公开的任务?cron.yaml文件中的URL是什么?

是的,这是可能的

cron.yaml

cron:                                                                                                                                                                                    
- description: daily summary job                                                                                                                                                         
  url: /cron-job-url                                                                                                                                                                     
  schedule: every 24 hours
例如,
/cron作业url
的请求处理程序中的(未测试)调用延迟任务

class CronJob(webapp2.RequestHandler):
    def get(self): 
         deferred.defer(do_something_expensive, "Hello, world!", 42, True)
         self.response.set_status(200)

app = webapp2.WSGIApplication([
    ('/cron-job-url', CronJob),
], debug=True)
是的,这是可能的

cron.yaml

cron:                                                                                                                                                                                    
- description: daily summary job                                                                                                                                                         
  url: /cron-job-url                                                                                                                                                                     
  schedule: every 24 hours
例如,
/cron作业url
的请求处理程序中的(未测试)调用延迟任务

class CronJob(webapp2.RequestHandler):
    def get(self): 
         deferred.defer(do_something_expensive, "Hello, world!", 42, True)
         self.response.set_status(200)

app = webapp2.WSGIApplication([
    ('/cron-job-url', CronJob),
], debug=True)

我曾尝试使用cron url访问延迟函数,但不起作用,cron似乎完全独立,无法访问延迟库。我曾尝试使用cron url访问延迟函数,但不起作用,cron似乎完全独立,无法访问延迟库。