Skip to content

Commit 91eb47d

Browse files
authored
Merge pull request #150 from open-runtimes/fix-realtime-race-condition
Fix: logging race condition
2 parents ffee2c2 + 8c9ba90 commit 91eb47d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

app/http.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -440,8 +440,11 @@ function cleanUp(Orchestration $orchestration, Table $activeRuntimes, array $net
440440
throw new Exception('Log file was not created in time.', 400);
441441
}
442442

443-
if (\file_exists($tmpLogging . '/logs.txt') && file_exists($tmpLogging . '/timings.txt')) {
444-
break;
443+
if (\file_exists($tmpLogging . '/logs.txt') && \file_exists($tmpLogging . '/timings.txt')) {
444+
$timings = \file_get_contents($tmpLogging . '/timings.txt') ?: '';
445+
if (\strlen($timings) > 0) {
446+
break;
447+
}
445448
}
446449

447450
// Ensure runtime is still present

0 commit comments

Comments
 (0)