Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
alastair committed Aug 13, 2021
2 parents 54e7673 + 807eb69 commit b1c42b2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ RUN touch /etc/service/dataset_eval/down

# Add cron jobs
COPY ./docker/cron/crontab /etc/cron.d/acousticbrainz
RUN chmod 0644 /etc/cron.d/acousticbrainz
COPY ./docker/cron/cron-config.service /etc/service/cron-config/run
COPY docker/cron/consul-template-cron-config.conf /etc/consul-template-cron-config.conf
RUN touch /etc/service/cron/down
Expand Down
5 changes: 5 additions & 0 deletions webserver/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ def not_found(error):
return jsonify_error(error)
return render_template('errors/404.html', error=error), 404

@app.errorhandler(429)
def too_many_requests(error):
# always returning JSON because this is only raised from API endpoints
return jsonify_error(error, 429)

@app.errorhandler(500)
def internal_server_error(error):
if request.path.startswith(webserver.API_PREFIX):
Expand Down

0 comments on commit b1c42b2

Please sign in to comment.