Compare commits

..

No commits in common. "22d258143195f2a01e17f6ae851b5465567d5b3f" and "59aeb3c74c48f853dc53dfbfd5ef9a02cd8bec48" have entirely different histories.

6
app.py
View file

@ -2092,11 +2092,7 @@ async def paperless_import_status(filename: str = Query(..., min_length=1, max_l
remote_path = f"{PAPERLESS_CONSUME_DIR}/{filename}" remote_path = f"{PAPERLESS_CONSUME_DIR}/{filename}"
command = ( command = (
f"if sudo -n test -f {remote_path}; then echo QUEUED; else echo CONSUMED; fi; " f"if sudo -n test -f {remote_path}; then echo QUEUED; else echo CONSUMED; fi; "
f"logs=$(sudo -n docker logs --since 15m paperless-ngx 2>&1); " f"sudo -n docker logs --since 15m paperless-ngx 2>&1 | grep -F -- {filename} | tail -20 || true"
f"printf \"%s\\n\" \"$logs\" | grep -F -- {filename} | tail -20 || true; "
f"task=$(printf \"%s\\n\" \"$logs\" | grep -F -- {filename} | "
f"grep -oE \"\\[[0-9a-f]{{8}}\\]\" | tail -1 | tr -d \"[]\"); "
f"if test -n \"$task\"; then printf \"%s\\n\" \"$logs\" | grep -F -- \"[$task]\" | tail -20; fi"
) )
rc, out, err = await asyncio.to_thread( rc, out, err = await asyncio.to_thread(
_ssh, PAPERLESS_GATEWAY, _paperless_gateway_command(command), 45 _ssh, PAPERLESS_GATEWAY, _paperless_gateway_command(command), 45