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

Refactor entry points so that they all have a main function. #13052

Merged
merged 2 commits into from
Jun 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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()