1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 06:42:42 +01:00

Move message posting to PhabricatorNotificationClient

Summary: Ref T4324. Centralize communication with the notification server. This will probably get less messy eventually.

Test Plan: Posted some messages.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T4324

Differential Revision: https://secure.phabricator.com/D8252
This commit is contained in:
epriestley 2014-02-17 15:59:51 -08:00
parent a1e7a4ccca
commit 1b8e129145
2 changed files with 14 additions and 5 deletions

View file

@ -161,16 +161,16 @@ final class PhabricatorFeedStoryPublisher {
} }
private function sendNotification($chrono_key) { private function sendNotification($chrono_key) {
$server_uri = PhabricatorEnv::getEnvConfig('notification.server-uri');
$data = array( $data = array(
'key' => (string)$chrono_key, 'key' => (string)$chrono_key,
); );
id(new HTTPSFuture($server_uri, $data)) try {
->setMethod('POST') PhabricatorNotificationClient::postMessage($data);
->setTimeout(1) } catch (Exception $ex) {
->resolve(); // Ignore, these are not critical.
}
} }
/** /**

View file

@ -25,4 +25,13 @@ final class PhabricatorNotificationClient {
return $status; return $status;
} }
public static function postMessage(array $data) {
$server_uri = PhabricatorEnv::getEnvConfig('notification.server-uri');
id(new HTTPSFuture($server_uri, $data))
->setMethod('POST')
->setTimeout(1)
->resolvex();
}
} }