perf: parallelize per-pack card fetches after roll_for_cards #99
Labels
No Label
ai-changes-requested
ai-failed
ai-pr-opened
ai-reviewed
ai-reviewing
ai-working
ai-working
bug
enhancement
feature
in-queue
performance
security
tech-debt
todo
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cal/paper-dynasty-discord#99
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
In
open_st_pr_packs()(helpers/main.py~line 1772-1776), after cards are created, they're fetched back one pack at a time:For 5 packs = 5 sequential DB round-trips.
Proposed Fix
Use
asyncio.gather()to fetch all packs' cards simultaneously. Alternatively, investigate whetherdb_post("cards")already returns the created cards, which would eliminate these fetches entirely.Impact
Moderate — 5 sequential calls reduced to 1 parallel batch.