Add a way to score every unscored lead without polling
Test and deploy / test (push) Successful in 2m1s
Test and deploy / deploy (push) Successful in 1m21s

A run caps its scoring at forty leads, so a first poll of several boards
left a backlog that could only be cleared by pressing "Check now"
repeatedly, re-fetching every source each time.

scoreJobLeads (JobLeadService.ScoreAll, "Score unscored" on /cv/leads)
re-applies the keyword filter and then scores every matched, unscored
lead, with no cap on the count and a one-hour limit on the time. A lead
Claude fails on is tried once per press rather than three times, so a
passing failure does not write it off. It shares the run lock and the
polled status with runJobLeadSync, and the page now reloads the leads
while either job is in flight.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-10-12 15:36:32 +01:00
co-authored by Claude Opus 5.5
parent af50e6c8ab
commit 299b5f5224
8 changed files with 216 additions and 41 deletions
+9 -1
View File
@@ -144,7 +144,15 @@ func (r *mutationResolver) RunJobLeadSync(ctx context.Context) (bool, error) {
if r.Store.JobLeads == nil {
return false, fmt.Errorf("job leads are not configured")
}
return r.Store.JobLeads.RunInBackground(), nil
return r.Store.JobLeads.RunInBackground(false), nil
}
// ScoreJobLeads is the resolver for the scoreJobLeads field.
func (r *mutationResolver) ScoreJobLeads(ctx context.Context) (bool, error) {
if r.Store.JobLeads == nil {
return false, fmt.Errorf("job leads are not configured")
}
return r.Store.JobLeads.RunInBackground(true), nil
}
// JobSources is the resolver for the jobSources field.