Fixed abandoned build processes sometimes still triggering a start (causing double-starts) made it more robust in regards to webui changes being intermixed: making the fetch a fire-and-forget to avoid errors, and waiting for the websocket connection to be re-established to avoid the browser attempting to reload when the server may not be up for a few seconds. Reviewed-on: #2234 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
11 lines
381 B
TypeScript
11 lines
381 B
TypeScript
import { args } from "@/src/helpers/commandLineArguments";
|
|
import { sendWsBroadcast } from "@/src/services/webService";
|
|
import { RequestHandler } from "express";
|
|
|
|
export const webuiFileChangeDetectedController: RequestHandler = (req, res) => {
|
|
if (args.dev && args.secret && req.query.secret == args.secret) {
|
|
sendWsBroadcast({ reload: true });
|
|
}
|
|
res.end();
|
|
};
|