Skip to content

Commit

Permalink
api: store snapshots for only 15 minutes
Browse files Browse the repository at this point in the history
15 minutes allow to upgrade a "fleet" of routers without rebuilding
every single time while staying fairly up to date if there's a new
snapshot imagebuilder available

Signed-off-by: Paul Spooren <[email protected]>
  • Loading branch information
aparcar committed Aug 11, 2021
1 parent 1d095f0 commit 61f5b84
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions asu/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,10 @@ def api_build():
req["upstream_url"] = current_app.config["UPSTREAM_URL"]
req["branch_data"] = get_branches()[req["branch"]]

if req["branch_data"]["snapshot"]:
result_ttl = "15m"
current_app.logger.info(f"Set snapshot request {request_hash} ttl to 15m")

job = get_queue().enqueue(
build,
req,
Expand Down

0 comments on commit 61f5b84

Please sign in to comment.