Skip to content

Commit

Permalink
src/gateway: serve enumerate cache if present
Browse files Browse the repository at this point in the history
  • Loading branch information
croissanne authored and achilleas-k committed Jul 18, 2024
1 parent 408f8cc commit a989d59
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/gateway/lambda_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,14 @@ def _run_enumerate(arguments):
),
)

# Serve the data from the enumerate cache if present
try:
obj = s3c.get_object(Bucket="rpmrepo-storage", Key="data/thread/meta/cache.json")
return _success(json.loads(obj['Body'].read()))
except botocore.exceptions.ClientError as e:
if not e.response['Error']['Code'] == "NoSuchKey":
return _error(500)

prefix = "data/thread/"
if "thread" in arguments:
prefix = prefix + arguments["thread"] + "/"
Expand Down

0 comments on commit a989d59

Please sign in to comment.