Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15534659
D17571.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D17571.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D17571: Fix isReadable() and isWritable() in SearchService
Attached
Detach File
Event Timeline
Log In to Comment