简体   繁体   English

Cron作业是否同时在Google App Engine中运行?

[英]Do cron jobs run simultaneously in google app engine?

Supposing I have two cron jobs in my app which run at the same time: 假设我的应用程序中有两个同时运行的cron作业:

- description: purge old articles
  url: /purge
  schedule: every 12 hours

- description: parse comp apps
  url: /comp
  schedule: every 12 hours

Do they run simultaneously within the GAE runtime? 它们是否在GAE运行时中同时运行? Or are they done sequentially -- if so, then in what order? 还是按顺序进行-如果是这样,那么按什么顺序进行? If they do run sequentially, would I have to use task queues in order to simulate simultaneous tasks (since, as far as I am aware, multithreading is not possible in app engine)? 如果它们确实按顺序运行,我是否必须使用任务队列来模拟同时执行的任务(据我所知,在应用程序引擎中无法进行多线程处理)?

Cron jobs run independently of each other. Cron作业彼此独立运行。 Therefore, there is no guarantee that they will run either sequentially or simultaneously. 因此,不能保证它们将顺序或同时运行。

If you want two tasks to be executed either sequentially or simultaneously, put them in the same cron job - there is no reason to create two cron jobs in this case. 如果要依次执行两个任务或同时执行两个任务,请将它们放在同一cron作业中-在这种情况下,没有理由创建两个cron作业。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM