larxius commited on
Commit
54d5b43
·
verified ·
1 Parent(s): 945e32f

Update backend/scanners_core.py

Browse files
Files changed (1) hide show
  1. backend/scanners_core.py +8 -8
backend/scanners_core.py CHANGED
@@ -238,12 +238,12 @@ def _run_scan_job(scan_id: str) -> None:
238
 
239
  # Per-module timeout per scan intensity (Deep gets 600s = 10 min per module)
240
  MODULE_TIMEOUTS = {
241
- "quick": 60,
242
- "standard": 120,
243
  "advanced": 180,
244
  "deep": 600,
245
  }
246
- _module_timeout = MODULE_TIMEOUTS.get((scan_type or "standard").lower(), 120)
247
 
248
  add_log(scan_id, "INFO", f"LarShield v2.0 - {scan_type.upper()} SCAN INITIATED")
249
  add_log(scan_id, "INFO", f"Target: {target}")
@@ -328,18 +328,18 @@ def _run_scan_job(scan_id: str) -> None:
328
 
329
  # Per-scan-type concurrency caps per phase
330
  MAX_WORKERS_PER_PHASE = {
331
- "quick": 6,
332
- "standard": 8,
333
- "advanced": 8,
334
  "deep": 8,
335
  "ssl": 4,
336
  "port": 2,
337
  }
338
- _max_workers = MAX_WORKERS_PER_PHASE.get((scan_type or "advanced").lower(), 8)
339
 
340
  # Wall-clock hard limits per scan type (seconds)
341
  HARD_LIMITS = {
342
- "quick": 300, # 5 min
343
  "advanced": 3600, # 1 hour
344
  "standard": 3600,
345
  "deep": 21600, # 6 hours
 
238
 
239
  # Per-module timeout per scan intensity (Deep gets 600s = 10 min per module)
240
  MODULE_TIMEOUTS = {
241
+ "quick": 120, # raised: 60 was too tight for slow probes
242
+ "standard": 180,
243
  "advanced": 180,
244
  "deep": 600,
245
  }
246
+ _module_timeout = MODULE_TIMEOUTS.get((scan_type or "standard").lower(), 180)
247
 
248
  add_log(scan_id, "INFO", f"LarShield v2.0 - {scan_type.upper()} SCAN INITIATED")
249
  add_log(scan_id, "INFO", f"Target: {target}")
 
328
 
329
  # Per-scan-type concurrency caps per phase
330
  MAX_WORKERS_PER_PHASE = {
331
+ "quick": 12, # raised: more concurrency to finish faster
332
+ "standard": 10,
333
+ "advanced": 10,
334
  "deep": 8,
335
  "ssl": 4,
336
  "port": 2,
337
  }
338
+ _max_workers = MAX_WORKERS_PER_PHASE.get((scan_type or "advanced").lower(), 10)
339
 
340
  # Wall-clock hard limits per scan type (seconds)
341
  HARD_LIMITS = {
342
+ "quick": 900, # 15 min (raised from 5 min — quick scan has 13 modules)
343
  "advanced": 3600, # 1 hour
344
  "standard": 3600,
345
  "deep": 21600, # 6 hours