Persist each payload's outcome as it happens, not in one batch

FixDaemonService
Ya
20 Agosti 2026, 21:54 UTC
Mwandishi
Kamo
Ahadi ya
29fdf8a

processEndpointPayloads looped over the batch mutating statuses in memory and saved them all at the end. createLead commits per lead, so any failure of that final save — or a crash mid-batch — left committed leads whose payloads were still RECEIVED. The next run (the cron is every minute) re-imported them, and because this path has no vendorLeadID dedup, every one became a second lead. A 789-row run produced 1389 leads that way: 600 businesses duplicated. Saving each payload's outcome immediately after its lead commits narrows the window from the whole batch to a single row. Not fixed here, and worth knowing: this path still has no duplicate detection at all — totalDuplicates is hard-wired to 0, unlike the import wizard. A vendor re-posting the same vendorLeadID gets another lead.

Mabadiliko yote

Je, unaona nini kuhusu usafiri?

Kila moja ya hizi updates ardhi katika nafasi yako ya kazi moja kwa moja. Kuanza bure na kuangalia kukua wiki baada ya wiki.

Kuwa Huru MileleMtazamo wa bei