Skip to content

Commit

Permalink
fix high CPU usage when out/err output callbacks are None
Browse files Browse the repository at this point in the history
  • Loading branch information
Umit Kablan committed Oct 4, 2024
1 parent 320ca58 commit fc557e1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pleskdistup/common/src/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ def exec_get_output_streamed(
kwargs["universal_newlines"] = True

process = subprocess.Popen(cmd, **kwargs)
if process_stdout_line is None and process_stderr_line is None:
process.communicate()
return process.returncode

while None is process.poll():
if process_stdout_line is not None:
if not process.stdout:
Expand Down

0 comments on commit fc557e1

Please sign in to comment.