Skip to content

Commit

Permalink
add cron jobs for ATProto polling posts and notifications
Browse files Browse the repository at this point in the history
fixes #942
  • Loading branch information
snarfed committed Apr 18, 2024
1 parent 8077a7f commit 5556f27
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
13 changes: 13 additions & 0 deletions cron.yaml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ def health_check():

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
Expand Down

0 comments on commit 5556f27

Please sign in to comment.