Spaces:
Runtime error
Runtime error
Update main.py
Browse files
main.py
CHANGED
|
@@ -254,10 +254,8 @@ async def analyze_payload_endpoint(payload: ThreatAnalysisRequest):
|
|
| 254 |
|
| 255 |
try:
|
| 256 |
start_time = time.perf_counter()
|
| 257 |
-
|
| 258 |
-
|
| 259 |
-
dom_data = extract_dom_features(url)
|
| 260 |
-
|
| 261 |
# ─────────────────────────────────────────────────────────
|
| 262 |
# CONCURRENT THREADING UPGRADE:
|
| 263 |
# Forces all 4 Groq agents to execute simultaneously without
|
|
|
|
| 254 |
|
| 255 |
try:
|
| 256 |
start_time = time.perf_counter()
|
| 257 |
+
# Push the synchronous scraper to a background thread to prevent server freezing
|
| 258 |
+
dom_data = await asyncio.to_thread(extract_dom_features, url)
|
|
|
|
|
|
|
| 259 |
# ─────────────────────────────────────────────────────────
|
| 260 |
# CONCURRENT THREADING UPGRADE:
|
| 261 |
# Forces all 4 Groq agents to execute simultaneously without
|