Compare commits
2 commits
59aeb3c74c
...
22d2581431
| Author | SHA1 | Date | |
|---|---|---|---|
| 22d2581431 | |||
| 3facb1f34c |
1 changed files with 5 additions and 1 deletions
6
app.py
6
app.py
|
|
@ -2092,7 +2092,11 @@ 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"sudo -n docker logs --since 15m paperless-ngx 2>&1 | grep -F -- {filename} | tail -20 || true"
|
f"logs=$(sudo -n docker logs --since 15m paperless-ngx 2>&1); "
|
||||||
|
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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue