]> Piment Noir Git Repositories - e-mobility-charging-stations-simulator.git/commit
refactor(bootstrap): factorize UI server start/stop logic
authorJérôme Benoit <jerome.benoit@sap.com>
Mon, 18 May 2026 21:49:47 +0000 (23:49 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Mon, 18 May 2026 21:49:47 +0000 (23:49 +0200)
commit24169fc1b3a4c49986cdab3a595cb6818aae0691
treecbdf711932fcec6380651d2fcc552a0b08e0de74
parenta3fcf5fcd060babcb88987de2e1b402cd9fdb376
refactor(bootstrap): factorize UI server start/stop logic

Extract idempotent helpers and remove duplication across the four
UI server lifecycle call sites:

- public startUIServer() now contains the actual logic instead of
  delegating to a private wrapper; start() calls it directly.
- new private stopUIServer() helper replaces the two inline stop
  blocks in gracefulShutdown() and restart().
- restart() guards syncUIServerTemplates() on uiServerStarted to
  avoid redundant template sync (twice when re-enabling, wasted
  call when the UI server is disabled or stopped). startUIServer()
  performs the sync itself when it actually starts the server.

No public API change. Behavior preserved.
src/charging-station/Bootstrap.ts