node-red-dashboard icon indicating copy to clipboard operation
node-red-dashboard copied to clipboard

dashboard settings and server are not reinitialized after a runtime restart

Open mblackstock opened this issue 8 years ago • 3 comments
trafficstars

When restarting the Node-RED runtime e.g. using Node-RED in an embedded application (RED.start(), then RED.stop() then RED.start() again, the dashboard does not pick up the server and settings changes.

See lines 9-12 in ui.js

mblackstock avatar Oct 01 '17 21:10 mblackstock

currently a node only has access to the close event... which happens every deploy of course, and we don't really want to re-initialise everything on every deploy. So we won't be able to fix this until we get access to the underlying stop event, which would need exposing in the core.

dceejay avatar Oct 29 '17 14:10 dceejay

is this a usable workaround: https://tech.scargill.net/node-red-initialisation/

bebo-dot-dev avatar Dec 29 '17 12:12 bebo-dot-dev

I'm not sure this is a usable work around for this issue. The problem isn't initialization of variables on startup of node red, but re-initialization of the dashboard system when the runtime is restarted using the embedded API (RED.stop() then RED.start()).

The dashboard is initialized only once when the runtime is started the first time. See https://github.com/node-red/node-red-dashboard/blob/463b4832cfe240cc6a892950aaa46580f45a713b/ui.js#L5 and the init() method called there.

Once the dashboard is initialized there is no way for it to 'clean up' then reinitialize itself, including re-reading the settings and adding a possibly reconfigured socketio server.

mblackstock avatar Dec 29 '17 17:12 mblackstock