mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-17 10:13:56 -05:00
Don't do decoding work if not needed
This commit is contained in:
parent
057f6016cc
commit
3dfeee9332
@ -537,27 +537,27 @@ class Consumer(LoggingMixin):
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Decode the output (if any)
|
# Decode the output (if any)
|
||||||
stdout_str = (
|
if len(completed_process.stdout):
|
||||||
completed_process.stdout.decode("utf8", errors="ignore")
|
stdout_str = (
|
||||||
.strip()
|
completed_process.stdout.decode("utf8", errors="ignore")
|
||||||
.split(
|
.strip()
|
||||||
"\n",
|
.split(
|
||||||
|
"\n",
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
|
||||||
stderr_str = (
|
|
||||||
completed_process.stderr.decode("utf8", errors="ignore")
|
|
||||||
.strip()
|
|
||||||
.split(
|
|
||||||
"\n",
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
if len(stdout_str):
|
|
||||||
self.log("info", "Script stdout:")
|
self.log("info", "Script stdout:")
|
||||||
for line in stdout_str:
|
for line in stdout_str:
|
||||||
self.log("info", line)
|
self.log("info", line)
|
||||||
|
|
||||||
if len(stderr_str):
|
if len(completed_process.stderr):
|
||||||
|
stderr_str = (
|
||||||
|
completed_process.stderr.decode("utf8", errors="ignore")
|
||||||
|
.strip()
|
||||||
|
.split(
|
||||||
|
"\n",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
self.log("warning", "Script stderr:")
|
self.log("warning", "Script stderr:")
|
||||||
for line in stderr_str:
|
for line in stderr_str:
|
||||||
self.log("warning", line)
|
self.log("warning", line)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user