api etiquette and 503 routing if necessary to disable api in the future

This commit is contained in:
crflynn
2018-12-12 10:52:43 -05:00
parent 41e79b3818
commit eba371d21e
3 changed files with 22 additions and 0 deletions

View File

@@ -54,6 +54,7 @@ def api_downloads_recent(package):
@blueprint.route("/packages/<package>/overall")
def api_downloads_overall(package):
"""Get the overall download time series of a package."""
# abort(503)
package = package.replace(".", "-")
mirrors = request.args.get("mirrors")
if mirrors == "true":
@@ -106,6 +107,7 @@ def api_downloads_system(package):
def generic_downloads(model, package, arg, name):
"""Generate a generic response."""
# abort(503)
package = package.replace(".", "-")
category = request.args.get(arg)
if category is not None: