Skip to content

Commit 97e9855

Browse files
committed
Fix endless waiting for file write
The wait should only happen when the file is written, not when it was already there and might have changed.
1 parent 6215150 commit 97e9855

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Generator.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,10 +231,10 @@ public function generate(string $namespace, string $namespaceTest, string $confi
231231

232232
file_put_contents($fileName, $fileContents);
233233
$this->state->generatedFiles->upsert($fileName, $fileContentsHash);
234-
}
235234

236-
while (! file_exists($fileName) || $fileContentsHash !== md5(file_get_contents($fileName))) {
237-
usleep(100);
235+
while (! file_exists($fileName) || $fileContentsHash !== md5(file_get_contents($fileName))) {
236+
usleep(100);
237+
}
238238
}
239239

240240
include_once $fileName;

0 commit comments

Comments
 (0)