From 47b19ea2f27edfb1994aa1b8fff3df2f54b8a664 Mon Sep 17 00:00:00 2001 From: Nelson Chan Date: Fri, 30 Jul 2021 12:24:46 +0800 Subject: [PATCH] ESLint: fix file --- server/database.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/server/database.js b/server/database.js index bde0c2792..ab7340413 100644 --- a/server/database.js +++ b/server/database.js @@ -1,8 +1,9 @@ const fs = require("fs"); -const {sleep} = require("../src/util"); -const {R} = require("redbean-node"); -const {setSetting, setting} = require("./util-server"); - +const { sleep } = require("../src/util"); +const { R } = require("redbean-node"); +const { + setSetting, setting, +} = require("./util-server"); class Database { @@ -95,11 +96,11 @@ class Database { const listener = (reason, p) => { Database.noReject = false; }; - process.addListener('unhandledRejection', listener); + process.addListener("unhandledRejection", listener); console.log("Closing DB") - while (true) { + for (;;) { Database.noReject = true; await R.close() await sleep(2000) @@ -112,7 +113,7 @@ class Database { } console.log("SQLite closed") - process.removeListener('unhandledRejection', listener); + process.removeListener("unhandledRejection", listener); } }