FlexServer: remove config from restart endpoint

The config endpoint now handles changing config values, so we only
need to handle restarts here.
pull/1141/head
Jordi Gutiérrez Hermoso 2 months ago committed by jordigh
parent 2d85ed1bfe
commit bc8e5f6837

@ -1877,14 +1877,13 @@ export class FlexServer implements GristServer {
const probes = new BootProbes(this.app, this, '/api', adminMiddleware);
probes.addEndpoints();
this.app.post('/api/admin/restart', requireInstallAdmin, expressWrap(async (req, resp) => {
const newConfig = req.body.newConfig;
this.app.post('/api/admin/restart', requireInstallAdmin, expressWrap(async (_, resp) => {
resp.on('finish', () => {
// If we have IPC with parent process (e.g. when running under
// Docker) tell the parent that we have a new environment so it
// can restart us.
if (process.send) {
process.send({ action: 'restart', newConfig });
process.send({ action: 'restart' });
}
});
// On the topic of http response codes, thus spake MDN:

Loading…
Cancel
Save