python-eel/Eel

Restart the server automatically when it shuts off

Open

#305 geöffnet am 25. Mai 2020

Auf GitHub ansehen
 (3 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Python (570 Forks)batch import
help wanted

Repository-Metriken

Stars
 (5.980 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

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

Contributor Guide