Differential D19735 Diff 47175 src/applications/diffusion/protocol/DiffusionRepositoryClusterEngine.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/protocol/DiffusionRepositoryClusterEngine.php
Show First 20 Lines • Show All 682 Lines • ▼ Show 20 Lines | private function synchronizeWorkingCopyFromDevices(array $device_phids) { | ||||
if (!$fetchable) { | if (!$fetchable) { | ||||
throw new Exception( | throw new Exception( | ||||
pht( | pht( | ||||
'Leader lost: no up-to-date nodes in repository cluster are '. | 'Leader lost: no up-to-date nodes in repository cluster are '. | ||||
'fetchable.')); | 'fetchable.')); | ||||
} | } | ||||
// If we can synchronize from multiple sources, choose one at random. | |||||
shuffle($fetchable); | |||||
$caught = null; | $caught = null; | ||||
foreach ($fetchable as $binding) { | foreach ($fetchable as $binding) { | ||||
try { | try { | ||||
$this->synchronizeWorkingCopyFromBinding($binding); | $this->synchronizeWorkingCopyFromBinding($binding); | ||||
$caught = null; | $caught = null; | ||||
break; | break; | ||||
} catch (Exception $ex) { | } catch (Exception $ex) { | ||||
$caught = $ex; | $caught = $ex; | ||||
▲ Show 20 Lines • Show All 128 Lines • Show Last 20 Lines |