feat: Timeout-Handling für rclone-Befehle hinzugefügt und Versionsnummer auf 1.0.37 erhöht
This commit is contained in:
22
app.py
22
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);
|
||||
|
||||
@@ -1 +1 @@
|
||||
1.0.36
|
||||
1.0.37
|
||||
Reference in New Issue
Block a user