Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 42bf020

Browse files
Ma27reivilibre
andauthored
Expose worker & homeserver as entrypoints in setup.py (#11449)
Co-authored-by: reivilibre <[email protected]>
1 parent 379f265 commit 42bf020

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

changelog.d/11449.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Expose synapse_homeserver and synapse_worker commands as entry points to run Synapse's main process and worker processes, respectively. Contributed by @Ma27.

setup.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,12 @@ def exec_file(path_segments):
152152
long_description=long_description,
153153
long_description_content_type="text/x-rst",
154154
python_requires="~=3.6",
155+
entry_points={
156+
"console_scripts": [
157+
"synapse_homeserver = synapse.app.homeserver:main",
158+
"synapse_worker = synapse.app.generic_worker:main",
159+
]
160+
},
155161
classifiers=[
156162
"Development Status :: 5 - Production/Stable",
157163
"Topic :: Communications :: Chat",

synapse/app/generic_worker.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,10 @@ def start(config_options: List[str]) -> None:
505505
_base.start_worker_reactor("synapse-generic-worker", config)
506506

507507

508-
if __name__ == "__main__":
508+
def main() -> None:
509509
with LoggingContext("main"):
510510
start(sys.argv[1:])
511+
512+
513+
if __name__ == "__main__":
514+
main()

0 commit comments

Comments
 (0)