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:
@ -198,6 +198,8 @@ class Refresher
|
||||
$this->setupConfiguration();
|
||||
$this->setupHooks();
|
||||
|
||||
$this->lockfile->lock();
|
||||
|
||||
$updated = $this->checkUpdates();
|
||||
|
||||
// If called with --check, only return exit status
|
||||
@ -217,7 +219,7 @@ class Refresher
|
||||
$this->callHooks($updated, 'after');
|
||||
$this->callScript('after');
|
||||
}
|
||||
|
||||
$this->lockfile->release();
|
||||
exit(($updated === null) ? 0 : 1);
|
||||
|
||||
} catch (\Throwable $t) {
|
||||
@ -226,6 +228,7 @@ class Refresher
|
||||
if (!$this->options['verbose']) {
|
||||
fprintf(STDERR, $this->log->asString()."\n");
|
||||
}
|
||||
$this->lockfile->release();
|
||||
exit(2);
|
||||
|
||||
}
|
||||
@ -253,6 +256,8 @@ class Refresher
|
||||
$lockfile = $this->options['lockfile'];
|
||||
if (!str_starts_with($lockfile,'/')) $lockfile = $this->path . "/" . $lockfile;
|
||||
|
||||
$this->log->append("Statefile: {$statefile}");
|
||||
$this->log->append("Lockfile: {$lockfile}");
|
||||
$this->state = new PersistentState($statefile); // $this->path . "/" . self::$StateFileName);
|
||||
$this->lockfile = new Lockfile($lockfile); // $this->path . "/" . self::$LockFileName);
|
||||
}
|
||||
@ -359,8 +364,6 @@ class Refresher
|
||||
private function checkUpdates(): ?array
|
||||
{
|
||||
|
||||
$this->lockfile->lock();
|
||||
|
||||
$checks = $this->config->getChecks();
|
||||
if (count($checks) === 0) {
|
||||
fwrite(STDERR, "error: couldn't find any images to check\n");
|
||||
|
Reference in New Issue
Block a user