fix tests
Continuous Integration / backend-tests (push) Successful in 32s
Continuous Integration / frontend-check (push) Successful in 16s
Continuous Integration / e2e-tests (push) Successful in 5m52s

This commit is contained in:
2026-04-30 22:49:25 -04:00
parent 80d47c582c
commit 79986066bf
+6 -2
View File
@@ -426,14 +426,18 @@ class ScannerService:
"""Polls system I/O pressure to enable dynamic back-off."""
while self.is_running or self.is_hashing:
try:
cpu_times = psutil.cpu_times_percent(interval=1)
cpu_times = psutil.cpu_times_percent(interval=0.1)
iowait_value = getattr(cpu_times, "iowait", 0.0)
with self._metrics_lock:
self.is_throttled = iowait_value > 5.0
self._current_iowait = iowait_value
except Exception:
pass
time.sleep(2)
# Use short sleep in a loop so we notice when the flags change
for _ in range(20):
if not (self.is_running or self.is_hashing):
return
time.sleep(0.1)
def _set_process_priority(self, level: str):
"""Adjusts the CPU and I/O priority of the current process."""