Page MenuHomePhabricator

D17571.diff
No OneTemporary

D17571.diff

diff --git a/src/infrastructure/cluster/search/PhabricatorSearchService.php b/src/infrastructure/cluster/search/PhabricatorSearchService.php
--- a/src/infrastructure/cluster/search/PhabricatorSearchService.php
+++ b/src/infrastructure/cluster/search/PhabricatorSearchService.php
@@ -16,6 +16,9 @@
const STATUS_OKAY = 'okay';
const STATUS_FAIL = 'fail';
+ const ROLE_WRITE = 'write';
+ const ROLE_READ = 'read';
+
public function __construct(PhabricatorFulltextStorageEngine $engine) {
$this->engine = $engine;
$this->hostType = $engine->getHostType();
@@ -84,30 +87,11 @@
}
public function isWritable() {
- return $this->hasRole('write');
+ return (bool)$this->getAllHostsForRole(self::ROLE_WRITE);
}
public function isReadable() {
- return $this->hasRole('read');
- }
-
- public function hasRole($role) {
- return isset($this->roles[$role]) && $this->roles[$role] !== false;
- }
-
- public function setRoles(array $roles) {
- foreach ($roles as $role => $val) {
- if ($val === false && isset($this->roles[$role])) {
- unset($this->roles[$role]);
- } else {
- $this->roles[$role] = $val;
- }
- }
- return $this;
- }
-
- public function getRoles() {
- return $this->roles;
+ return (bool)$this->getAllHostsForRole(self::ROLE_READ);
}
public function getPort() {

File Metadata

Mime Type
text/plain
Expires
Fri, Apr 25, 1:11 AM (1 d, 15 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7722679
Default Alt Text
D17571.diff (1 KB)

Event Timeline