From 5222d12a5fca4983e00471f0b0c23ac193189b35 Mon Sep 17 00:00:00 2001 From: Terranom674 Date: Thu, 3 Sep 2026 20:34:45 +0200 Subject: [PATCH] Show WebDAV worker lock state in scan diagnostic --- include/webdav_scan_diagnostic.inc.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/include/webdav_scan_diagnostic.inc.php b/include/webdav_scan_diagnostic.inc.php index b9aa2c3..ead3088 100644 --- a/include/webdav_scan_diagnostic.inc.php +++ b/include/webdav_scan_diagnostic.inc.php @@ -60,8 +60,15 @@ function bratonien_tools_run_webdav_scan_diagnostic() $parts[] = 'WebDAV #'.$id.': FEHLER: '.(string)$report['fatal'].' (Exit '.(int)$report['exit_code'].')'; continue; } + + $lock_state = (string)($report['worker_lock_state'] ?? 'unknown'); + if ($lock_state === 'free') $lock_text = 'Worker-Lock frei'; + elseif ($lock_state === 'busy') $lock_text = 'Worker-Lock BELEGT'; + elseif ($lock_state === 'open_failed') $lock_text = 'Worker-Lock NICHT OEFFENBAR'; + else $lock_text = 'Worker-Lock unbekannt'; + $parts[] = sprintf( - 'WebDAV #%d: Mapping %d Dateien, Shadow %d Links, %d passend, %d defekt, %d ohne Mapping, %d doppelt (Exit %d).', + 'WebDAV #%d: Mapping %d Dateien, Shadow %d Links, %d passend, %d defekt, %d ohne Mapping, %d doppelt; %s%s (Exit %d).', $id, (int)($report['mapping_files'] ?? 0), (int)($report['shadow_links'] ?? 0), @@ -69,11 +76,13 @@ function bratonien_tools_run_webdav_scan_diagnostic() (int)($report['broken'] ?? 0), (int)($report['unmapped'] ?? 0), (int)($report['duplicates'] ?? 0), + $lock_text, + !empty($report['worker_lock_detail']) ? ' - '.(string)$report['worker_lock_detail'] : '', (int)$report['exit_code'] ); } return array( - 'message'=>($failed ? 'Scan-Test fehlgeschlagen. ' : 'Scan-Test erfolgreich. ').implode(' ', $parts), + 'message'=>($failed ? 'Scan-/Lock-Test auffaellig. ' : 'Scan-/Lock-Test erfolgreich. ').implode(' ', $parts), ); }