Skip to content

Commit

Permalink
fix error with pax crashing without a cache
Browse files Browse the repository at this point in the history
  • Loading branch information
maradotwebp committed Apr 18, 2022
1 parent 2473597 commit 4db99ed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/api/cfclient.nim
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ proc fetchAddons*(projectIds: seq[int], chunk = true): Future[seq[CfAddon]] {.as
# otherwise just fetch them
result = result.concat(await fetchAddonsChunks(missingIds))

# check that all addons have been retrieved
# check that all addons have been retrieved & fetch missing ones
if projectIds.len != result.len:
let currentIds = result.map((x) => x.projectId)
let missingIds = projectIds.filter((x) => x notin currentIds)
raise newException(CfApiError, "one of the addons of project ids '" & $missingIds & "' was not found.")
result = result.concat(await all(missingIds.map((x) => fetchAddon(x, lookupCache = false))))
# sort so the output is deterministic
result = result.sortTo(projectIds, (x) => x.projectId)

Expand Down

0 comments on commit 4db99ed

Please sign in to comment.