Skip to content

Commit

Permalink
File isRunning detection: Read file can fail (transaction does not ex…
Browse files Browse the repository at this point in the history
…ist).
  • Loading branch information
janbarasek committed Aug 22, 2021
1 parent e0b5eb9 commit c126394
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Transaction/FileTransactionProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function isTransactionRunning(?string $transactionName = null): bool

$content = @file_get_contents($file); // @ is escalated to exception
if ($content === false) {
throw new \RuntimeException('Unable to read file "' . $file . '". ' . $this->getLastError());
return false;
}
if (((float) (explode('|', $content)[0] ?? '0')) - microtime(true) > 0) {
return true;
Expand Down

0 comments on commit c126394

Please sign in to comment.