Bugfixes
* Fixed a bug where the lockfile would be released on exit even if it wasn't locked by the process * Disabled the phpx build as it is broken
This commit is contained in:
		@@ -8,6 +8,8 @@ class Lockfile
 | 
			
		||||
 | 
			
		||||
    private int $maxLock = 3600;
 | 
			
		||||
 | 
			
		||||
    private bool $locked = false;
 | 
			
		||||
 | 
			
		||||
    public function __construct(string $filename)
 | 
			
		||||
    {
 | 
			
		||||
        $this->filename = $filename;
 | 
			
		||||
@@ -22,15 +24,16 @@ class Lockfile
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        touch($this->filename);
 | 
			
		||||
        $this->locked = true;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function release()
 | 
			
		||||
    {
 | 
			
		||||
        if (file_exists($this->filename)) {
 | 
			
		||||
        if ($this->locked && file_exists($this->filename)) {
 | 
			
		||||
            unlink($this->filename);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $this->locked = false;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user