feat: Fehlerbehandlung für rclone-Befehle verbessert und Versionsnummer auf 1.0.38 erhöht
This commit is contained in:
15
app.py
15
app.py
@@ -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)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
1.0.37
|
1.0.38
|
||||||
Reference in New Issue
Block a user