1

情况:我在 App Engine 上有暂存和生产应用程序。我正在使用Scheduled Backups为我的实体运行备份,这与开发人员声明的 cron 作业略有不同。这意味着我无法在备份 cron 启动之前检查它是暂存应用程序还是生产应用程序。

目前,唯一的方法是在部署到登台应用程序之前手动清除 cron.xml。

所以问题是:有没有更好/自动化的方法?

4

1 回答 1

0

If you have separate branches in your VCS for staging vs. production, you can create your own configuration entry such as CRON_ENABLED, and set it to "true" in the production branch and "false" in the staging branch. The cron code just checks for CRON_ENABLED and exits if it's not "true". It's not ideal but it's cleaner than checking for some GAE-specific architectural thing like an instance ID.

于 2013-09-27T21:52:03.177 回答