Make scan directory manager thread safe

This commit is contained in:
Julian Stirling 2025-08-04 19:48:33 +01:00
parent 4b4256aefe
commit 9be9097246
4 changed files with 161 additions and 0 deletions

View file

@ -717,6 +717,9 @@ class SmartScanThing(lt.Thing):
This is a wrapper around scan manager's delete_scan that logs to the
invocation logger id there is a problem.
"""
if self._ongoing_scan is not None and scan_name == self._ongoing_scan.name:
logger.error("Attempted to delete ongoing scan.")
return False
try:
self._scan_dir_manager.delete_scan(scan_name)
return True