fix: [30388f42] Worker v1.9.8 - THE FORTRESS - Restore strict Ground Truth filters
This commit is contained in:
@@ -45,19 +45,26 @@ def process_job(job, so_client: SuperOfficeClient, queue: JobQueue):
|
|||||||
Returns: (STATUS, MESSAGE)
|
Returns: (STATUS, MESSAGE)
|
||||||
STATUS: 'SUCCESS', 'SKIPPED', 'DELETED', 'RETRY', 'FAILED'
|
STATUS: 'SUCCESS', 'SKIPPED', 'DELETED', 'RETRY', 'FAILED'
|
||||||
"""
|
"""
|
||||||
logger.info(f"--- [WORKER v1.9.7] Processing Job {job['id']} ({job['event_type']}) ---")
|
logger.info(f"--- [WORKER v1.9.8 - THE FORTRESS] Processing Job {job['id']} ({job['event_type']}) ---")
|
||||||
payload = job['payload']
|
payload = job['payload']
|
||||||
event_low = job['event_type'].lower()
|
event_low = job['event_type'].lower()
|
||||||
|
|
||||||
# --- NOISE REDUCTION: STAMMDATEN FILTER ---
|
# --- NOISE REDUCTION: STRICT STAMMDATEN FILTER ---
|
||||||
# We only care about changes to Name or Website.
|
# We ONLY react to changes in critical fields. Our own UDF updates must be ignored.
|
||||||
# Everything else (like UDF updates) should NOT trigger a re-analysis.
|
|
||||||
changes = [c.lower() for c in payload.get("Changes", [])]
|
changes = [c.lower() for c in payload.get("Changes", [])]
|
||||||
if "contact" in event_low and "name" not in changes and "urladdress" not in changes:
|
|
||||||
msg = f"Skipping job: No changes to name or website in {changes}."
|
if "contact.changed" in event_low:
|
||||||
logger.info(f"⏭️ {msg}")
|
if "name" not in changes and "urladdress" not in changes:
|
||||||
return ("SKIPPED", msg)
|
msg = f"Skipping contact change: No changes to name or website in {changes}."
|
||||||
# ------------------------------------------
|
logger.info(f"⏭️ {msg}")
|
||||||
|
return ("SKIPPED", msg)
|
||||||
|
|
||||||
|
if "person.changed" in event_low:
|
||||||
|
if "jobtitle" not in changes and "contact_id" not in changes:
|
||||||
|
msg = f"Skipping person change: No changes to jobtitle or contact mapping in {changes}."
|
||||||
|
logger.info(f"⏭️ {msg}")
|
||||||
|
return ("SKIPPED", msg)
|
||||||
|
# -------------------------------------------------
|
||||||
|
|
||||||
# --- CIRCUIT BREAKER: DETECT ECHOES ---
|
# --- CIRCUIT BREAKER: DETECT ECHOES ---
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user