|
1 | 1 | #!/usr/bin/env python3
|
2 | 2 |
|
3 |
| -from typing import Any, Dict, IO, List, Optional, Set, Text, Tuple, cast |
| 3 | +from typing import Any, Dict, IO, List, NoReturn, Optional, Set, Text, Tuple, cast |
4 | 4 | from types import FrameType
|
5 | 5 |
|
6 | 6 | import sys
|
@@ -232,7 +232,7 @@ def maybe_restart_mirroring_script() -> None:
|
232 | 232 | backoff.fail()
|
233 | 233 | raise Exception("Failed to reload too many times, aborting!")
|
234 | 234 |
|
235 |
| -def process_loop(log: Optional[IO[Any]]) -> None: |
| 235 | +def process_loop(log: Optional[IO[Any]]) -> NoReturn: |
236 | 236 | restart_check_count = 0
|
237 | 237 | last_check_time = time.time()
|
238 | 238 | recieve_backoff = RandomExponentialBackoff()
|
@@ -767,7 +767,7 @@ def maybe_forward_to_zephyr(message: Dict[str, Any]) -> None:
|
767 | 767 | # whole process
|
768 | 768 | logger.exception("Error forwarding message:")
|
769 | 769 |
|
770 |
| -def zulip_to_zephyr(options: int) -> None: |
| 770 | +def zulip_to_zephyr(options: int) -> NoReturn: |
771 | 771 | # Sync messages from zulip to zephyr
|
772 | 772 | logger.info("Starting syncing messages.")
|
773 | 773 | backoff = RandomExponentialBackoff(timeout_success_equivalent=120)
|
@@ -1146,7 +1146,6 @@ def die_gracefully(signal: int, frame: FrameType) -> None:
|
1146 | 1146 | # Run the zulip => zephyr mirror in the child
|
1147 | 1147 | configure_logger(logger, "zulip=>zephyr")
|
1148 | 1148 | zulip_to_zephyr(options)
|
1149 |
| - sys.exit(0) |
1150 | 1149 | else:
|
1151 | 1150 | child_pid = None
|
1152 | 1151 | CURRENT_STATE = States.ZephyrToZulip
|
|
0 commit comments