[go: up one dir, main page]

Reload watchghost server on file modifications

If I update configuration files, I may want watchghost server reload automatically. I already try to use tornado.autoreload module which, as the doc said, Automatically detect code changes in development. In the file watchghost/__init__.py line 17:

app = Application(
    debug=options.debug, cookie_secret=options.secret,
    static_path=os.path.join(os.path.dirname(__file__), 'static'),
    template_path=os.path.join(os.path.dirname(__file__), 'templates'),
    autoreload=True) # => I add this line

When I run bin/watchghost-server.py, I have this exception:

Attaching to watchghost_watchghost_1
watchghost_1  | Traceback (most recent call last):
watchghost_1  |   File "./bin/watchghost-server.py", line 15, in <module>
watchghost_1  |     AsyncIOMainLoop().install()
watchghost_1  |   File "/usr/local/lib/python3.6/site-packages/tornado/ioloop.py", line 180, in install
watchghost_1  |     assert not IOLoop.initialized()
watchghost_1  | AssertionError
watchghost_watchghost_1 exited with code 1

Thank you