Merge branch 'stable'

This commit is contained in:
Dylan K. Taylor
2021-02-12 17:34:25 +00:00
5 changed files with 20 additions and 9 deletions

View File

@@ -130,7 +130,7 @@ final class Filesystem{
public static function createLockFile(string $lockFilePath) : ?int{
$resource = fopen($lockFilePath, "a+b");
if($resource === false){
throw new \InvalidArgumentException("Invalid lock file path");
throw new \InvalidArgumentException("Invalid lock file path or read/write permissions denied");
}
if(!flock($resource, LOCK_EX | LOCK_NB)){
//wait for a shared lock to avoid race conditions if two servers started at the same time - this makes sure the

View File

@@ -73,6 +73,7 @@ final class MainLoggerThread extends \Thread{
*/
private function writeLogStream($logResource) : void{
while($this->buffer->count() > 0){
/** @var string $chunk */
$chunk = $this->buffer->shift();
fwrite($logResource, $chunk);
}