Peter Mutwiri commited on
Commit ·
0394104
1
Parent(s): bd51393
added redis sleep time to 5 sec
Browse files- app/mapper.py +1 -1
app/mapper.py
CHANGED
|
@@ -98,7 +98,7 @@ def poll_for_entity(org_id: str, source_id: str, timeout: int = 30) -> dict:
|
|
| 98 |
entity_info = json.loads(data)
|
| 99 |
print(f"[poll] ✅ Received: {entity_info['entity_type']} ({entity_info['confidence']:.2%})")
|
| 100 |
return entity_info
|
| 101 |
-
time.sleep(
|
| 102 |
|
| 103 |
# ⚠️ EMERGENCY FALLBACK: If worker fails, detect synchronously
|
| 104 |
print(f"[poll] ⚠️ TIMEOUT after {timeout}s - running direct detection")
|
|
|
|
| 98 |
entity_info = json.loads(data)
|
| 99 |
print(f"[poll] ✅ Received: {entity_info['entity_type']} ({entity_info['confidence']:.2%})")
|
| 100 |
return entity_info
|
| 101 |
+
time.sleep(5.0) # Poll every 2seconds (reduces Redis load)
|
| 102 |
|
| 103 |
# ⚠️ EMERGENCY FALLBACK: If worker fails, detect synchronously
|
| 104 |
print(f"[poll] ⚠️ TIMEOUT after {timeout}s - running direct detection")
|