mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 05:54:47 -04:00
Clean up ShardedWorkerHandlingConfig
(#9466)
* Split ShardedWorkerHandlingConfig This is so that we have a type level understanding of when it is safe to call `get_instance(..)` (as opposed to `should_handle(..)`). * Remove special cases in ShardedWorkerHandlingConfig. `ShardedWorkerHandlingConfig` tried to handle the various different ways it was possible to configure federation senders and pushers. This led to special cases that weren't hit during testing. To fix this the handling of the different cases is moved from there and `generic_worker` into the worker config class. This allows us to have the logic in one place and allows the rest of the code to ignore the different cases.
This commit is contained in:
parent
0b5c967813
commit
2927921942
14 changed files with 128 additions and 63 deletions
|
@ -248,7 +248,7 @@ class HomeServer(metaclass=abc.ABCMeta):
|
|||
self.start_time = None # type: Optional[int]
|
||||
|
||||
self._instance_id = random_string(5)
|
||||
self._instance_name = config.worker_name or "master"
|
||||
self._instance_name = config.worker.instance_name
|
||||
|
||||
self.version_string = version_string
|
||||
|
||||
|
@ -760,7 +760,4 @@ class HomeServer(metaclass=abc.ABCMeta):
|
|||
|
||||
def should_send_federation(self) -> bool:
|
||||
"Should this server be sending federation traffic directly?"
|
||||
return self.config.send_federation and (
|
||||
not self.config.worker_app
|
||||
or self.config.worker_app == "synapse.app.federation_sender"
|
||||
)
|
||||
return self.config.send_federation
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue