Skip to content

Commit

Permalink
feat: use only latest log for software
Browse files Browse the repository at this point in the history
Use only the latest log for software, so to avoid processing the
same software multiple times.
  • Loading branch information
bfabio committed Jul 24, 2024
1 parent 9e47f1f commit c7fc75d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def software_logs(days):
page_after = body["links"]["next"]
page = bool(page_after)

# XXX: get last for repo
seen_entities = set()

for log in logs:
match = re.search(
Expand All @@ -110,6 +110,11 @@ def software_logs(days):
if not entity or entity == "//":
continue

if entity in seen_entities:
continue

seen_entities.add(entity)

res = requests.get(f"{API_BASEURL}{entity}")
res.raise_for_status()

Expand Down

0 comments on commit c7fc75d

Please sign in to comment.