python-eel/Eel

Restart the server automatically when it shuts off

Open

#305 建立於 2020年5月25日

在 GitHub 查看
 (3 留言) (0 反應) (0 負責人)Python (570 fork)batch import
help wanted

倉庫指標

Star
 (5,980 star)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

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

貢獻者指南