fix(scraper): deduplicate job_hash in Python before PostgreSQL batch upsert

This commit is contained in:
JobsBoard Deployer 2026-09-05 11:49:16 -04:00
parent 3aad6705d0
commit 83ee7378da

View file

@ -168,6 +168,7 @@ def _upsert_postgres(jobs_list: list, db_url: str):
"""
records = []
seen_hashes = set()
now = datetime.datetime.now(datetime.timezone.utc)
for j in jobs_list:
@ -175,6 +176,9 @@ def _upsert_postgres(jobs_list: list, db_url: str):
if not job_url:
continue
job_hash = generate_job_hash(job_url)
if job_hash in seen_hashes:
continue
seen_hashes.add(job_hash)
job_id = "job_" + str(uuid.uuid4()).replace("-", "")[:20]
records.append((