Restart the server automatically when it shuts off
#305 aberto em 25 de mai. de 2020
Métricas do repositório
- Stars
- (5.980 stars)
- Métricas de merge de PR
- (Nenhuma PRs mesclada em 30d)
Description
The problem Hi,
I'm having an issue where the server suddenly disconnects, and for some reason this happens a lot. This forces me to restart the server and open a new window every time, and of course that's not ideal for the users. So I was wondering if there is a way to use the close_callback to restart the server without having to open a new window every time.
I tried the following code and it successfully restarts the server, but it opens a new window every time a redirecting button/link is clicked even if the server is still running.
import eel
eel.init('UI')
def callback(path, websockets):
eel.start(path, port=5002, close_callback=callback)
eel.start('/Templates/admin/employees.html', port=5002, close_callback=callback)
And if I set the 'mode' argument to False, then the server restarts only if it is closed first, but the current window won't be connected to it, and I have to open a new window to connect to the server.
Desktop:
- OS: Windows
- Browser: Chrome - v81.0.4044.138 (Official Build) (64-bit)
- Eel version: 0.12.3