review · segments
Fix lot update pipeline issues
pi 246 events 3 segments
segment 1 of 3
Investigate system, create admin log viewer, and fix stale lots metric
The assistant reviewed CLAUDE.md, README.md, git history, and code to understand the lot update pipeline. It identified that the admin dashboard's stale lots count was misleading because it counted all filled lots as stale for running auctions. It created an admin log viewer with controller, service, view, route, and dashboard link. It also fixed the stale lots SQL in statsForAuctions() to use time windows matching the staleLots() definition.
outcome
Admin log viewer added at /admin/logs; stale lots metric on dashboard now shows only lots that actually need refresh.
next steps
- Deploy code and run migration for parse_issues columns
- Restart Horizon to apply new supervisor configuration
key decisions
- Added AdminLogReader service to safely tail log files, restricting to laravel*.log only.
- Fixed stale lots SQL in statsForAuctions() to use time windows matching staleLots() definition.
open questions
- Whether the stale lots fix will significantly change perceived backlog for running auctions.
1 month ago → 1 month ago
segment 2 of 3
Gracefully handle failed lot parsing and fix Horizon queue bottleneck
After seeing Horizon output showing 288k jobs on lots-update with only one process and a FillLot failing with LotDataException, the assistant implemented graceful parse handling: removed LotDataException throws, added parse_issues JSON column and parse_attempted_at timestamp, allowed partial fills, and suppressed retries for shell_not_found for 6 hours. It split the single supervisor into two dedicated supervisors (lots-fill with 4 processes, lots-update with 14 processes in production). It increased default per-run caps (fill 40, update 200) and added an end-of-auction boost scheduler running every minute with higher caps and shorter cooldown. Added isEndingWithinHours and hasActiveEndingWithinHours to Auction model. Added --max option to fill/update commands.
outcome
Lot model now tracks parse_issues and parse_attempted_at; FillLot/UpdateLot jobs no longer hard-fail on missing data; Horizon config split for better queue isolation; throughput caps increased with end-of-auction boost.
next steps
- Run php artisan migrate to add parse_issues and parse_attempted_at columns
- Run php artisan horizon:terminate to reload supervisors
- Monitor Horizon to ensure new supervisor processes are allocated correctly
- Verify that failing lots are no longer retried and parse issues are visible in admin
key decisions
- Moved LotDataException handling from Lot model to job catch blocks to prevent hard failures, recording parse issues instead.
- Split supervisor-lots into two separate supervisors to avoid queue starvation by auto-balancing.
- Increased default fill per run from 15 to 40 and update from 100 to 200; added boost for auctions ending within 6 hours.
- Excluded lots with recent parse_attempted_at and shell_not_found from fill queue for 6 hours.
open questions
- Whether the new horizon processes (4 fill, 14 update) will saturate server resources or exceed Puppeteer instance limits.
- Whether the 6-hour cooldown for shell_not_found is appropriate or needs tuning.
- Whether the end-of-auction boost (every minute) may cause resource contention with regular jobs.
1 month ago → 1 month ago
segment 3 of 3
Create summary document for code review
The user requested a markdown document summarizing all changes. The assistant created LOT_UPDATE_PIPELINE_CHANGES.md covering problem summary, changes by area, file checklist, deploy steps, risks, and follow-ups.
outcome
LOT_UPDATE_PIPELINE_CHANGES.md created at project root with detailed explanation for another agent.
next steps
—
key decisions
- Created comprehensive markdown document to facilitate code review by another agent.
open questions
—
1 month ago → 1 month ago