Changeset View
Changeset View
Standalone View
Standalone View
src/applications/repository/storage/PhabricatorRepository.php
Show First 20 Lines • Show All 2,369 Lines • ▼ Show 20 Lines | public function synchronizeWorkingCopyBeforeWrite() { | ||||
$this->clusterWriteLock = $write_lock; | $this->clusterWriteLock = $write_lock; | ||||
} | } | ||||
/** | /** | ||||
* @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( | ||||
'Trying to synchronize after write, but not holding a write '. | 'Trying to synchronize after write, but not holding a write '. | ||||
'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(); | ||||
// NOTE: This means we're still bumping the version when pushes fail. We | // NOTE: This means we're still bumping the version when pushes fail. We | ||||
// could select only un-rejected events instead to bump a little less | // could select only un-rejected events instead to bump a little less | ||||
// often. | // often. | ||||
$new_log = id(new PhabricatorRepositoryPushEventQuery()) | $new_log = id(new PhabricatorRepositoryPushEventQuery()) | ||||
▲ Show 20 Lines • Show All 216 Lines • Show Last 20 Lines |