hch-dev commited on
Commit
7101cf7
·
verified ·
1 Parent(s): 9ca55cd

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +2 -4
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
- # Extract DOM data synchronously or asynchronously based on your dom_scraper configuration
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