Reputation: 1
My cron jobs on Google App Engine stopped to work few days ago. It responds a 404 code. It's strange, because I didn't changed yaml files, and it was working properly.
Any help is appreciated. Thanks!
cron.yaml
cron: - description: Push a "tick" onto pubsub every 5 minutes url: /publish/minutes-5-tick schedule: every 5 minutes - description: Push a "tick" onto pubsub every hour url: /publish/hourly-tick schedule: every 1 hours - description: Push a "tick" onto pubsub every hour url: /publish/hourly-tick-2 schedule: every 1 hours - description: Push a "tick" onto pubsub every day url: /publish/daily-tick schedule: every 24 hours - description: Push a "tick" onto pubsub every week url: /publish/weekly-tick schedule: every saturday 00:00
app.yaml
runtime: python27 api_version: 1 threadsafe: true handlers: # Handler for the pubsub cron. - url: /publish/.* script: main.app login: admin secure: always - url: /.* script: main.app libraries: - name: webapp2 version: latest - name: pycrypto version: latest - name: ssl version: latest instance_class: F1
main.py
class PushToPubSub(webapp2.RequestHandler): def get(self, topic): pubsub_utils.publish_to_topic(topic, str(time.time())) self.response.headers['Content-Type'] = 'application/json' self.response.write(json.dumps({"status": "200"})) app = webapp2.WSGIApplication([ webapp2.Route(r'/publish/', handler=PushToPubSub) ], debug=True)
Upvotes: 0
Views: 319
Reputation: 1
The solution was redo steps described here https://github.com/FirebaseExtended/functions-cron
Thanks.
Upvotes: 0
Reputation: 11370
You don't have a url handler for /publish/hourly-tick
. Try:
webapp2.Route(r'/publish/<topic:\w+>', handler=PushToPubSub),
That will send "hourly-tick" as the topic to be handled in PushToPubSub
Upvotes: 1