server: Fix stop Gate creation and check

This commit is contained in:
Richard Hansen 2022-01-02 16:46:35 -05:00
parent 10c55a2328
commit c8d45586c1

View file

@ -165,7 +165,7 @@ exports.start = async () => {
return express.server; return express.server;
}; };
let stopDoneGate; const stopDoneGate = new Gate();
exports.stop = async () => { exports.stop = async () => {
switch (state) { switch (state) {
case State.STARTING: case State.STARTING:
@ -187,7 +187,6 @@ exports.stop = async () => {
throw new Error(`unknown State: ${state.toString()}`); throw new Error(`unknown State: ${state.toString()}`);
} }
logger.info('Stopping Etherpad...'); logger.info('Stopping Etherpad...');
const stopDoneGate = new Gate();
state = State.STOPPING; state = State.STOPPING;
try { try {
let timeout = null; let timeout = null;