Skip to content

Commit 047213a

Browse files
committed
Improve logic
1 parent fb5c61e commit 047213a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/KubernetesCluster.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,12 +274,13 @@ protected function watchLogsPath(string $path, Closure $callback, array $query =
274274
$separator = \strpos($chunk, "\n");
275275
if ($separator !== false) {
276276
$extra = \substr($chunk, $separator + \strlen("\n"));
277-
$chunk = \substr($chunk, 0, $separator);
277+
$chunk = \substr($chunk, 0, $separator) + "\n";
278278

279-
$call = call_user_func($callback, $data);
279+
$call = call_user_func($callback, $chunk);
280280
if (!is_null($call)) {
281281
fclose($sock);
282282
unset($data);
283+
unset($chunk);
283284
return $call;
284285
}
285286

0 commit comments

Comments
 (0)