feat: Timeout-Handling für rclone-Befehle hinzugefügt und Versionsnummer auf 1.0.37 erhöht

This commit is contained in:
2026-05-09 13:21:54 +02:00
parent 632f9e348c
commit 652353c641
2 changed files with 16 additions and 8 deletions

22
app.py
View File

@@ -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);

View File

@@ -1 +1 @@
1.0.36
1.0.37