From 5556f2756b6368b2be9f87bc24707b1690a2ce58 Mon Sep 17 00:00:00 2001 From: Ryan Barrett Date: Wed, 17 Apr 2024 19:53:04 -0700 Subject: [PATCH] add cron jobs for ATProto polling posts and notifications fixes #942 --- cron.yaml | 13 +++++++++++++ hub.py | 4 ++-- 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 cron.yaml diff --git a/cron.yaml b/cron.yaml new file mode 100644 index 0000000..b7b81f2 --- /dev/null +++ b/cron.yaml @@ -0,0 +1,13 @@ +# timezone defaults to UTC +# docs: https://cloud.google.com/appengine/docs/standard/python3/scheduling-jobs-with-cron-yaml + +cron: +- description: ATProto poll posts + url: /queue/atproto-poll-posts + schedule: every 15 minutes + target: hub + +- description: ATProto poll notifications + url: /queue/atproto-poll-notifs + schedule: every 15 minutes + target: hub diff --git a/hub.py b/hub.py index 12504d9..038d912 100644 --- a/hub.py +++ b/hub.py @@ -60,11 +60,11 @@ lexrpc.flask_server.init_flask(arroba.server.server, app) app.add_url_rule('/queue/atproto-poll-notifs', view_func=atproto.poll_notifications, - methods=['POST']) + methods=['GET', 'POST']) app.add_url_rule('/queue/atproto-poll-posts', view_func=atproto.poll_posts, - methods=['POST']) + methods=['GET', 'POST']) @app.post('/queue/atproto-commit') @flask_util.cloud_tasks_only