This repository was archived by the owner on Apr 26, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed
Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change 1+ Allow modules to retrieve the current instance's server name and worker name.
Original file line number Diff line number Diff line change @@ -401,6 +401,32 @@ def email_app_name(self) -> str:
401401 """
402402 return self ._hs .config .email .email_app_name
403403
404+ @property
405+ def server_name (self ) -> str :
406+ """The server name for the local homeserver.
407+
408+ Added in Synapse v1.53.0.
409+ """
410+ return self ._server_name
411+
412+ @property
413+ def worker_name (self ) -> Optional [str ]:
414+ """The name of the worker this specific instance is running as per the
415+ "worker_name" configuration setting, or None if it's the main process.
416+
417+ Added in Synapse v1.53.0.
418+ """
419+ return self ._hs .config .worker .worker_name
420+
421+ @property
422+ def worker_app (self ) -> Optional [str ]:
423+ """The name of the worker app this specific instance is running as per the
424+ "worker_app" configuration setting, or None if it's the main process.
425+
426+ Added in Synapse v1.53.0.
427+ """
428+ return self ._hs .config .worker .worker_app
429+
404430 async def get_userinfo_by_id (self , user_id : str ) -> Optional [UserInfo ]:
405431 """Get user info by user_id
406432
You can’t perform that action at this time.
0 commit comments