在google app引擎上在登台环境中处理cron作业 [英] Handling cron jobs on staging environment on google app engine
问题描述
我想在Google App Engine上设置暂存环境,并在以下问题中找到了良好的指导:如何在Google App Engine上设置暂存环境
问题我是在这种情况下如何处理Cron作业。理想情况下,我只需要更改版本以部署到生产,但是我担心这将意味着所有的cron作业也运行在临时版本上,或者不是这样?
如果您使用的是不同版本的方法,您需要注意此:
如果目标参数已经为作业设置,请求是
发送到指定的版本。否则Cron请求会发送到应用程序的
默认版本。
我一直在使用 target
参数将cron作业定向到不同的模块,基于上面的引用我可以使用将作业指向不同的版本=https://cloud.google.com/appengine/docs/python/modules/routing#routing_via_url =nofollow>通过网址的模块路由,可能类似如下:
target:version
或
target:version-dot-module
个人而言,我喜欢不同的应用程序方法,以确保暂存和生产环境之间没有干扰,即使执行大规模重新工作破坏向后兼容性)。
对于方法,我使用来自两个不同分支的两个不同的工作区,它们之间有最小的差异(应用程序
.yaml
文件和其他与分期相关的增量):
- a
staging
工作区&分支 - a
生产
工作区&分支
每当我对 这个方法可能会在不同版本的方法中使用好的, I want to set up a staging environment on Google App Engine and have found good guidance for this in the following question: How to set up a staging environment on Google App Engine The only unanswered question I have is how to handle Cron jobs in this case. Ideally I'll just have to change the version to deploy to production, however I fear that that would mean that all cron jobs also run on the staging version, or is this not the case? If you're using a different version approach you need to pay attention to this: If the target parameter has been set for a job, the request is
sent to the specified version. Otherwise Cron requests are sent to the
default version of the application. I've been using the or Personally I prefer a different application approach to ensure no interference between the staging and the production environments, even when performing massive re-works breaking backwards compatibility :) As for the method, I use 2 different workspaces from 2 different branches of the code, which have minimal differences between them (the Whenever I'm happy with the code in the Probably the method would be usable in a different version approach as well, the 这篇关于在google app引擎上在登台环境中处理cron作业的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! staging
分支中的代码感到满意:生产 / code> one c 更新
生产
工作区并从中部署 - >更新 工作区(
c> staging
工作区 - >更新 c> staging
app
.yaml
文件中的版本
字段在2个分支中是不同的。
target
parameter to direct cron jobs to different modules, based on the quote above I guess it could be used to direct jobs to different versions as well, using module routing via URL, probably something like this: target: version
target: version-dot-module
application
fields in the .yaml
files and maybe other staging-related deltas):
staging
workspace & branchproduction
workspace & branchstaging
branch I:
staging
branch in the production
oneproduction
workspace and deploy from it -> updating the production
appstaging
workspace (committing the changes to the staging
branch as well if so desired)staging
workspace -> updating the staging
appversion
fields in the .yaml
files being different in the 2 branches.