From 652353c6419376cb45d017e2634a1be302cbeaa5 Mon Sep 17 00:00:00 2001 From: Tobias Leuschner Date: Sat, 9 May 2026 13:21:54 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20Timeout-Handling=20f=C3=BCr=20rclone-Be?= =?UTF-8?q?fehle=20hinzugef=C3=BCgt=20und=20Versionsnummer=20auf=201.0.37?= =?UTF-8?q?=20erh=C3=B6ht?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.py | 22 +++++++++++++++------- version.txt | 2 +- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/app.py b/app.py index 6dfbb59..a86bf4a 100644 --- a/app.py +++ b/app.py @@ -872,10 +872,16 @@ upload_lock = threading.Lock() def _rclone(*args, timeout=60): - return subprocess.run( - ['rclone', '--config', str(RCLONE_CONF)] + list(args), - capture_output=True, text=True, timeout=timeout - ) + try: + return subprocess.run( + ['rclone', '--config', str(RCLONE_CONF)] + list(args), + capture_output=True, text=True, timeout=timeout + ) + except subprocess.TimeoutExpired as e: + if e.process: + e.process.kill() + # Fake CompletedProcess mit Fehlercode + return subprocess.CompletedProcess(args, 1, stdout='', stderr='Timeout') def _rclone_obscure(pw): @@ -2355,9 +2361,11 @@ async function utSave(){ const r=await api('/upload/targets','POST',body); if(r.error){flash('ut-form-flash','err',r.error);return;} flash('ut-form-flash','warn','Teste Verbindung - Schreibzugriff wird geprüft...'); - const t=await api('/upload/targets/'+r.id+'/test','POST'); - if(t.ok){flash('ut-form-flash','ok','✓ Verbindung OK - Lesen & Schreiben erfolgreich');utToggleForm();await loadUTs();} - else flash('ut-form-flash','err','✗ '+(t.error||'Test fehlgeschlagen')); + try{ + const t=await api('/upload/targets/'+r.id+'/test','POST'); + if(t.ok){flash('ut-form-flash','ok','✓ Verbindung OK - Lesen & Schreiben erfolgreich');utToggleForm();await loadUTs();} + else flash('ut-form-flash','err','✗ '+(t.error||'Test fehlgeschlagen')); + }catch(e){flash('ut-form-flash','err','✗ Test fehlgeschlagen (Server-Timeout)');} } async function utTest(id){ const btn=$('ut-test-'+id), res=$('ut-test-result-'+id); diff --git a/version.txt b/version.txt index d1c66e6..314a62a 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.0.36 \ No newline at end of file +1.0.37 \ No newline at end of file