diff options
author | Thomas Steur <tsteur@users.noreply.github.com> | 2020-12-15 06:42:26 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-15 06:42:26 +0300 |
commit | caec48a374d9de8a1505d5b8997fea8bfc72745c (patch) | |
tree | 29620b0dbc80870439d7d71c84093fd06be5f571 | |
parent | 646043bcadcc23b57e7ec51e3d99a18aec8b9ec7 (diff) |
Only mark process as finished after fully sending the output (#16952)
Otherwise there could be a race condition in cli multi where it thinks the process is finished, but the output hasn't been sent and written yet. Thus ending up with an "empty response" error under circumstances or only reading a partial output. This should only affect Matomo for WordPress though
-rw-r--r-- | core/CliMulti/RequestCommand.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/CliMulti/RequestCommand.php b/core/CliMulti/RequestCommand.php index 49c521f31f..f2e07dcb94 100644 --- a/core/CliMulti/RequestCommand.php +++ b/core/CliMulti/RequestCommand.php @@ -78,13 +78,13 @@ class RequestCommand extends ConsoleCommand require_once PIWIK_INCLUDE_PATH . $indexFile; - if (!empty($process)) { - $process->finishProcess(); - } - while (ob_get_level()) { echo ob_get_clean(); } + + if (!empty($process)) { + $process->finishProcess(); + } } private function isTestModeEnabled() |