Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/cluster/PhabricatorDatabaseRef.php
Show First 20 Lines • Show All 387 Lines • ▼ Show 20 Lines | foreach ($refs as $ref) { | ||||
'This host has a "replica" role, but is not replicating data '. | 'This host has a "replica" role, but is not replicating data '. | ||||
'from a master (no output from "SHOW SLAVE STATUS").')); | 'from a master (no output from "SHOW SLAVE STATUS").')); | ||||
} else { | } else { | ||||
$ref->setReplicaStatus(self::REPLICATION_OKAY); | $ref->setReplicaStatus(self::REPLICATION_OKAY); | ||||
} | } | ||||
if ($is_replica) { | if ($is_replica) { | ||||
$latency = idx($replica_status, 'Seconds_Behind_Master'); | $latency = idx($replica_status, 'Seconds_Behind_Master'); | ||||
if (!strlen($latency)) { | if (!phutil_nonempty_string($latency)) { | ||||
$ref->setReplicaStatus(self::REPLICATION_NOT_REPLICATING); | $ref->setReplicaStatus(self::REPLICATION_NOT_REPLICATING); | ||||
} else { | } else { | ||||
$latency = (int)$latency; | $latency = (int)$latency; | ||||
$ref->setReplicaDelay($latency); | $ref->setReplicaDelay($latency); | ||||
if ($latency > 30) { | if ($latency > 30) { | ||||
$ref->setReplicaStatus(self::REPLICATION_SLOW); | $ref->setReplicaStatus(self::REPLICATION_SLOW); | ||||
$ref->setReplicaMessage( | $ref->setReplicaMessage( | ||||
pht( | pht( | ||||
▲ Show 20 Lines • Show All 344 Lines • Show Last 20 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0