From dcf3a31944b526d0919eedfd5d4d608febe4a663 Mon Sep 17 00:00:00 2001 From: epriestley Date: Tue, 3 Jul 2012 07:46:38 -0700 Subject: [PATCH] Minor, unlock after discovery exception. --- .../daemon/PhabricatorRepositoryPullLocalDaemon.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/applications/repository/daemon/PhabricatorRepositoryPullLocalDaemon.php b/src/applications/repository/daemon/PhabricatorRepositoryPullLocalDaemon.php index 4c0412ca41..9f022cd54a 100644 --- a/src/applications/repository/daemon/PhabricatorRepositoryPullLocalDaemon.php +++ b/src/applications/repository/daemon/PhabricatorRepositoryPullLocalDaemon.php @@ -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(); }