server: Fix stop Gate creation and check

pull/5347/head
Richard Hansen 2022-01-02 16:46:35 -05:00
parent 10c55a2328
commit c8d45586c1
1 changed files with 1 additions and 2 deletions

View File

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