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

Commit

Permalink
Refactor entry points so that they all have a main function. (#13052)
Browse files Browse the repository at this point in the history
  • Loading branch information
reivilibre authored Jun 14, 2022
1 parent c99b511 commit 5b645ae
Show file tree
Hide file tree
Showing 11 changed files with 61 additions and 10 deletions.
1 change: 1 addition & 0 deletions changelog.d/13052.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Refactor entry points so that they all have a `main` function.
7 changes: 6 additions & 1 deletion synapse/app/appservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
from synapse.app.generic_worker import start
from synapse.util.logcontext import LoggingContext

if __name__ == "__main__":

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


if __name__ == "__main__":
main()
7 changes: 6 additions & 1 deletion synapse/app/client_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
from synapse.app.generic_worker import start
from synapse.util.logcontext import LoggingContext

if __name__ == "__main__":

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


if __name__ == "__main__":
main()
7 changes: 6 additions & 1 deletion synapse/app/event_creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
from synapse.app.generic_worker import start
from synapse.util.logcontext import LoggingContext

if __name__ == "__main__":

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


if __name__ == "__main__":
main()
7 changes: 6 additions & 1 deletion synapse/app/federation_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
from synapse.app.generic_worker import start
from synapse.util.logcontext import LoggingContext

if __name__ == "__main__":

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


if __name__ == "__main__":
main()
7 changes: 6 additions & 1 deletion synapse/app/federation_sender.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
from synapse.app.generic_worker import start
from synapse.util.logcontext import LoggingContext

if __name__ == "__main__":

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


if __name__ == "__main__":
main()
7 changes: 6 additions & 1 deletion synapse/app/frontend_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
from synapse.app.generic_worker import start
from synapse.util.logcontext import LoggingContext

if __name__ == "__main__":

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


if __name__ == "__main__":
main()
7 changes: 6 additions & 1 deletion synapse/app/media_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
from synapse.app.generic_worker import start
from synapse.util.logcontext import LoggingContext

if __name__ == "__main__":

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


if __name__ == "__main__":
main()
7 changes: 6 additions & 1 deletion synapse/app/pusher.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
from synapse.app.generic_worker import start
from synapse.util.logcontext import LoggingContext

if __name__ == "__main__":

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


if __name__ == "__main__":
main()
7 changes: 6 additions & 1 deletion synapse/app/synchrotron.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
from synapse.app.generic_worker import start
from synapse.util.logcontext import LoggingContext

if __name__ == "__main__":

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


if __name__ == "__main__":
main()
7 changes: 6 additions & 1 deletion synapse/app/user_dir.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
from synapse.app.generic_worker import start
from synapse.util.logcontext import LoggingContext

if __name__ == "__main__":

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


if __name__ == "__main__":
main()

0 comments on commit 5b645ae

Please sign in to comment.