mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-22 14:52:41 +01:00
Minor, unlock after discovery exception.
This commit is contained in:
parent
c821639e93
commit
dcf3a31944
1 changed files with 9 additions and 3 deletions
|
@ -139,13 +139,19 @@ final class PhabricatorRepositoryPullLocalDaemon
|
|||
$this->pullRepository($repository);
|
||||
|
||||
if (!$no_discovery) {
|
||||
// TODO: It would be nice to discover only if we pulled something,
|
||||
// but this isn't totally trivial.
|
||||
|
||||
$lock_name = get_class($this).':'.$callsign;
|
||||
$lock = PhabricatorGlobalLock::newLock($lock_name);
|
||||
$lock->lock();
|
||||
|
||||
// TODO: It would be nice to discover only if we pulled something,
|
||||
// but this isn't totally trivial.
|
||||
$this->discoverRepository($repository);
|
||||
try {
|
||||
$this->discoverRepository($repository);
|
||||
} catch (Exception $ex) {
|
||||
$lock->unlock();
|
||||
throw $ex;
|
||||
}
|
||||
|
||||
$lock->unlock();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue