[go: up one dir, main page]

Skip to content
This repository has been archived by the owner on Feb 7, 2023. It is now read-only.

Commit

Permalink
Add cron configuration and restore startrank endpoint for cron
Browse files Browse the repository at this point in the history
  • Loading branch information
timwoj committed Apr 17, 2019
1 parent 578c52a commit 49bb775
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cron.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
cron:
- description: "progress builder job"
url: /startrank
schedule: every day 02:00
timezone: America/Phoenix

8 changes: 8 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ def rank():
return ranker.rank()
return ranker.start_ranking()

# This is used by the cron job to start ranking automatically. We call the ranker
# but we don't care about the redirect that it responds with. Instead just return
# a 200 so the cron job doesn't fail.
@app.route('/startrank')
def startrank():
ranker.start_ranking()
return '', 200

@app.route('/builder', methods=['POST'])
def builder():
return ranker.run_builder(request)
Expand Down

0 comments on commit 49bb775

Please sign in to comment.