1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-24 14:30:56 +01:00

Ignore post-write repository synchronization if no devices are configured

Summary: Fixes T10789. If we aren't configured with a device, we never grabbed a lock in the first place, and should not expect one to be held.

Test Plan: Pushed non-cluster-configured Git SSH repository.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10789

Differential Revision: https://secure.phabricator.com/D15692
This commit is contained in:
epriestley 2016-04-12 18:18:58 -07:00
parent 110223c1a7
commit 33060d1652

View file

@ -2375,6 +2375,11 @@ final class PhabricatorRepository extends PhabricatorRepositoryDAO
* @task sync * @task sync
*/ */
public function synchronizeWorkingCopyAfterWrite() { public function synchronizeWorkingCopyAfterWrite() {
$device = AlmanacKeys::getLiveDevice();
if (!$device) {
return;
}
if (!$this->clusterWriteLock) { if (!$this->clusterWriteLock) {
throw new Exception( throw new Exception(
pht( pht(
@ -2382,14 +2387,6 @@ final class PhabricatorRepository extends PhabricatorRepositoryDAO
'lock!')); 'lock!'));
} }
$device = AlmanacKeys::getLiveDevice();
if (!$device) {
throw new Exception(
pht(
'Trying to synchronize after write, but this host is not an '.
'Almanac device.'));
}
$repository_phid = $this->getPHID(); $repository_phid = $this->getPHID();
$device_phid = $device->getPHID(); $device_phid = $device->getPHID();