Differential D17710 Diff 42602 src/applications/notification/client/PhabricatorNotificationClient.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/notification/client/PhabricatorNotificationClient.php
| Show All 12 Lines | foreach ($servers as $server) { | ||||
| $server->loadServerStatus(); | $server->loadServerStatus(); | ||||
| return; | return; | ||||
| } | } | ||||
| return; | return; | ||||
| } | } | ||||
| public static function tryToPostMessage(array $data) { | public static function tryToPostMessage(array $data) { | ||||
| $unique_id = Filesystem::readRandomCharacters(32); | |||||
| $data = $data + array( | |||||
| 'uniqueID' => $unique_id, | |||||
| ); | |||||
| $servers = PhabricatorNotificationServerRef::getEnabledAdminServers(); | $servers = PhabricatorNotificationServerRef::getEnabledAdminServers(); | ||||
| shuffle($servers); | shuffle($servers); | ||||
| foreach ($servers as $server) { | foreach ($servers as $server) { | ||||
| try { | try { | ||||
| $server->postMessage($data); | $server->postMessage($data); | ||||
| return; | return; | ||||
| } catch (Exception $ex) { | } catch (Exception $ex) { | ||||
| // Just ignore any issues here. | // Just ignore any issues here. | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||