Begins watching source files for changes. .. versionchanged:: 5.0 The ``io_loop`` argument (deprecated since version 4.1) has been removed.
(check_time: int = 500)
| 112 | |
| 113 | |
| 114 | def start(check_time: int = 500) -> None: |
| 115 | """Begins watching source files for changes. |
| 116 | |
| 117 | .. versionchanged:: 5.0 |
| 118 | The ``io_loop`` argument (deprecated since version 4.1) has been removed. |
| 119 | """ |
| 120 | io_loop = ioloop.IOLoop.current() |
| 121 | if io_loop in _io_loops: |
| 122 | return |
| 123 | _io_loops[io_loop] = True |
| 124 | if len(_io_loops) > 1: |
| 125 | gen_log.warning("tornado.autoreload started more than once in the same process") |
| 126 | modify_times: Dict[str, float] = {} |
| 127 | callback = functools.partial(_reload_on_update, modify_times) |
| 128 | scheduler = ioloop.PeriodicCallback(callback, check_time) |
| 129 | scheduler.start() |
| 130 | |
| 131 | |
| 132 | def wait() -> None: |