Skip to content
Snippets Groups Projects
Unverified Commit 5c16c330 authored by Brendan Abolivier's avatar Brendan Abolivier Committed by GitHub
Browse files

Allow modules to retrieve server and worker names (#11868)

Fixes #10701
parent 64ec45fc
No related branches found
No related tags found
No related merge requests found
Allow modules to retrieve the current instance's server name and worker name.
......@@ -401,6 +401,32 @@ class ModuleApi:
"""
return self._hs.config.email.email_app_name
@property
def server_name(self) -> str:
"""The server name for the local homeserver.
Added in Synapse v1.53.0.
"""
return self._server_name
@property
def worker_name(self) -> Optional[str]:
"""The name of the worker this specific instance is running as per the
"worker_name" configuration setting, or None if it's the main process.
Added in Synapse v1.53.0.
"""
return self._hs.config.worker.worker_name
@property
def worker_app(self) -> Optional[str]:
"""The name of the worker app this specific instance is running as per the
"worker_app" configuration setting, or None if it's the main process.
Added in Synapse v1.53.0.
"""
return self._hs.config.worker.worker_app
async def get_userinfo_by_id(self, user_id: str) -> Optional[UserInfo]:
"""Get user info by user_id
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment