Skip to content

Commit dcf3a31

Browse files
author
epriestley
committed
Minor, unlock after discovery exception.
1 parent c821639 commit dcf3a31

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/applications/repository/daemon/PhabricatorRepositoryPullLocalDaemon.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,19 @@ public function run() {
139139
$this->pullRepository($repository);
140140

141141
if (!$no_discovery) {
142+
// TODO: It would be nice to discover only if we pulled something,
143+
// but this isn't totally trivial.
144+
142145
$lock_name = get_class($this).':'.$callsign;
143146
$lock = PhabricatorGlobalLock::newLock($lock_name);
144147
$lock->lock();
145148

146-
// TODO: It would be nice to discover only if we pulled something,
147-
// but this isn't totally trivial.
148-
$this->discoverRepository($repository);
149+
try {
150+
$this->discoverRepository($repository);
151+
} catch (Exception $ex) {
152+
$lock->unlock();
153+
throw $ex;
154+
}
149155

150156
$lock->unlock();
151157
}

0 commit comments

Comments
 (0)