Avoid loading all domains
1 unresolved thread
1 unresolved thread
Its quite slow with a lot of different domains and aliases.
Its called on every request with an active aliases (called from DomainNegotiator).
Closes #3405191
Merge request reports
Activity
Filter activity
added 3 commits
-
13204607...45b5c3c1 - 2 commits from branch
project:2.0.x
- ff0122b0 - Avoid loading all domains
-
13204607...45b5c3c1 - 2 commits from branch
added 6 commits
-
ff0122b0...a40d8a7d - 5 commits from branch
project:2.0.x
- 7a3c524c - Avoid loading all domains
-
ff0122b0...a40d8a7d - 5 commits from branch
153 153 */ 154 154 public function create(array $values = []) { 155 155 $default = $this->loadDefaultId(); 156 $domains = $this->loadMultiple(); 156 $count = $this->getQuery()->accessCheck(FALSE)->count()->execute(); Looks good.
Here is a suggestion for improvement:
Same query used in other places
- https://git.drupalcode.org/project/domain/-/blob/2.0.x/domain/src/Form/DomainForm.php?ref_type=heads#L87
- https://git.drupalcode.org/project/domain/-/blob/2.0.x/domain/src/Entity/Domain.php?ref_type=heads#L162
and would better to wrap it in a separate method in
DomainStorage
and use this method in all calls and cover it with simple test.
added 2 commits
Please register or sign in to reply