feat: Fehlerbehandlung für rclone-Befehle verbessert und Versionsnummer auf 1.0.38 erhöht

This commit is contained in:
2026-05-09 13:24:48 +02:00
parent 652353c641
commit 18e54c4be9
2 changed files with 10 additions and 7 deletions

15
app.py
View File

@@ -877,11 +877,10 @@ def _rclone(*args, timeout=60):
['rclone', '--config', str(RCLONE_CONF)] + list(args), ['rclone', '--config', str(RCLONE_CONF)] + list(args),
capture_output=True, text=True, timeout=timeout capture_output=True, text=True, timeout=timeout
) )
except subprocess.TimeoutExpired as e: except subprocess.TimeoutExpired:
if e.process: return subprocess.CompletedProcess(args, 1, stdout='', stderr=f'Timeout nach {timeout}s')
e.process.kill() except Exception as e:
# Fake CompletedProcess mit Fehlercode return subprocess.CompletedProcess(args, 1, stdout='', stderr=str(e))
return subprocess.CompletedProcess(args, 1, stdout='', stderr='Timeout')
def _rclone_obscure(pw): def _rclone_obscure(pw):
@@ -1242,7 +1241,11 @@ def r_upload_toggle(tid):
@app.route('/api/upload/targets/<tid>/test', methods=['POST']) @app.route('/api/upload/targets/<tid>/test', methods=['POST'])
def r_upload_test(tid): def r_upload_test(tid):
ok, err = test_remote(tid) try:
ok, err = test_remote(tid)
except Exception as e:
log.exception('upload test failed')
ok, err = False, str(e)
return jsonify(ok=ok, error=err) return jsonify(ok=ok, error=err)

View File

@@ -1 +1 @@
1.0.37 1.0.38