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

Commit

Permalink
Expose worker & homeserver as entrypoints in setup.py (#11449)
Browse files Browse the repository at this point in the history
Co-authored-by: reivilibre <oliverw@matrix.org>
  • Loading branch information
Ma27 and reivilibre authored Nov 30, 2021
1 parent 379f265 commit 42bf020
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.d/11449.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Expose synapse_homeserver and synapse_worker commands as entry points to run Synapse's main process and worker processes, respectively. Contributed by @Ma27.
6 changes: 6 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,12 @@ def exec_file(path_segments):
long_description=long_description,
long_description_content_type="text/x-rst",
python_requires="~=3.6",
entry_points={
"console_scripts": [
"synapse_homeserver = synapse.app.homeserver:main",
"synapse_worker = synapse.app.generic_worker:main",
]
},
classifiers=[
"Development Status :: 5 - Production/Stable",
"Topic :: Communications :: Chat",
Expand Down
6 changes: 5 additions & 1 deletion synapse/app/generic_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,10 @@ def start(config_options: List[str]) -> None:
_base.start_worker_reactor("synapse-generic-worker", config)


if __name__ == "__main__":
def main() -> None:
with LoggingContext("main"):
start(sys.argv[1:])


if __name__ == "__main__":
main()

0 comments on commit 42bf020

Please sign in to comment.