Minor, unlock after discovery exception.
This commit is contained in:
@@ -139,13 +139,19 @@ final class PhabricatorRepositoryPullLocalDaemon
|
|||||||
$this->pullRepository($repository);
|
$this->pullRepository($repository);
|
||||||
|
|
||||||
if (!$no_discovery) {
|
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_name = get_class($this).':'.$callsign;
|
||||||
$lock = PhabricatorGlobalLock::newLock($lock_name);
|
$lock = PhabricatorGlobalLock::newLock($lock_name);
|
||||||
$lock->lock();
|
$lock->lock();
|
||||||
|
|
||||||
// TODO: It would be nice to discover only if we pulled something,
|
try {
|
||||||
// but this isn't totally trivial.
|
$this->discoverRepository($repository);
|
||||||
$this->discoverRepository($repository);
|
} catch (Exception $ex) {
|
||||||
|
$lock->unlock();
|
||||||
|
throw $ex;
|
||||||
|
}
|
||||||
|
|
||||||
$lock->unlock();
|
$lock->unlock();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user