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):
|
def _rclone(*args, timeout=60):
|
||||||
return subprocess.run(
|
try:
|
||||||
['rclone', '--config', str(RCLONE_CONF)] + list(args),
|
return subprocess.run(
|
||||||
capture_output=True, text=True, timeout=timeout
|
['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):
|
def _rclone_obscure(pw):
|
||||||
@@ -2355,9 +2361,11 @@ async function utSave(){
|
|||||||
const r=await api('/upload/targets','POST',body);
|
const r=await api('/upload/targets','POST',body);
|
||||||
if(r.error){flash('ut-form-flash','err',r.error);return;}
|
if(r.error){flash('ut-form-flash','err',r.error);return;}
|
||||||
flash('ut-form-flash','warn','Teste Verbindung - Schreibzugriff wird geprüft...');
|
flash('ut-form-flash','warn','Teste Verbindung - Schreibzugriff wird geprüft...');
|
||||||
const t=await api('/upload/targets/'+r.id+'/test','POST');
|
try{
|
||||||
if(t.ok){flash('ut-form-flash','ok','✓ Verbindung OK - Lesen & Schreiben erfolgreich');utToggleForm();await loadUTs();}
|
const t=await api('/upload/targets/'+r.id+'/test','POST');
|
||||||
else flash('ut-form-flash','err','✗ '+(t.error||'Test fehlgeschlagen'));
|
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){
|
async function utTest(id){
|
||||||
const btn=$('ut-test-'+id), res=$('ut-test-result-'+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