0

I have a Google Cloud Platform application that runs on several Google App Engine Standard instances. One app has a cron.xml with some cron jobs defined pointing to REST endpoints on that app.

Now I want to create a cron job in another app, so I created another cron.xml, all the REST endpoints and deployed. After deployment I realized the deployment erased the cron jobs defined by the first app. I read somewhere that you can only have one cron.xml defined PER PROJECT and not PER APP. Is this correct? I have been reading the documentation and a book on Google App Engine and could not find an answer.

OCDev
  • 655
  • 1
  • 7
  • 21
  • Possible duplicate of [GAE Microservices with dedicated Cron Jobs per microservice](https://stackoverflow.com/questions/48008198/gae-microservices-with-dedicated-cron-jobs-per-microservice) – Dan Cornilescu Jan 11 '18 at 01:32

2 Answers2

0

cron.yaml/cron.xml apply per application.

Dave W. Smith
  • 24,318
  • 4
  • 40
  • 46
  • Thanks! I am wondering if I am doing something wrong. I have two apps App1 and App2. I upload the cron jobs for my App1 with this command: `gcloud app deploy src/main/webapp/WEB-INF/cron.yaml ` When I do the same for App2, all the cron jobs for App1 dissappear, seems that it overrides the cron jobs for App1. I also tried the following command `./appengine-java-sdk/bin/appcfg.sh -A your-app-id -V app-version update [YOUR_APP_DIR]` with the same result... and the Google Cloud documentation is atrocious. – OCDev Jan 05 '18 at 18:06
  • In your position, check whether I'm issuing the `gcloud deploy` for App2 in a directory that has an `app.yaml` that reflects App1, and then try it in a directory that doesn't. There *might* be a bug in `gcloud`. – Dave W. Smith Jan 05 '18 at 19:15
0

I just got an answer from Google Cloud support. Apparently there can be only one CRON file PER PROJECT. Each upload of a cron file will override the previous upload. A workaround for this would be add a TARGET tag for the URLs that are not in the same App as the CRON file. Adding target: will re-route the request to the appName app.

OCDev
  • 655
  • 1
  • 7
  • 21