Add a way to score every unscored lead without polling
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:
@@ -98,5 +98,14 @@ export const useJobLeadsStore = defineStore("jobLeads", () => {
|
||||
return data.runJobLeadSync;
|
||||
}
|
||||
|
||||
return { leads, loading, error, status, fetch, dismiss, restore, promote, fetchDescription, fetchStatus, runSync };
|
||||
/**
|
||||
* Score every unscored lead in the inbox without polling any source. Same
|
||||
* contract as runSync(): resolves at once, and fetchStatus() shows it finish.
|
||||
*/
|
||||
async function scoreAll() {
|
||||
const data = await gql(`mutation ScoreJobLeads { scoreJobLeads }`);
|
||||
return data.scoreJobLeads;
|
||||
}
|
||||
|
||||
return { leads, loading, error, status, fetch, dismiss, restore, promote, fetchDescription, fetchStatus, runSync, scoreAll };
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user