The watcher mode (-w) is working only partially because once there's a change detected, it shut downs the existing server and initializes another one, but doesn't update the reference, so on the following updates, the newer server is not being shutdown, causing bind: address already in use error.
So, this PR basically ensures that the watcher callback updates the reference to the server with the new one on every "restart" (after every event detected by the watcher).
The watcher mode (
-w
) is working only partially because once there's a change detected, it shut downs the existing server and initializes another one, but doesn't update the reference, so on the following updates, the newer server is not being shutdown, causingbind: address already in use
error.So, this PR basically ensures that the watcher callback updates the reference to the server with the new one on every "restart" (after every event detected by the watcher).
Fixes #148