From b604807cfe90c01ac8a0ca96c1e0892edc6c6997 Mon Sep 17 00:00:00 2001 From: LouisLam Date: Thu, 2 Sep 2021 20:42:55 +0800 Subject: [PATCH] create data dir if not exists --- server/database.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/database.js b/server/database.js index f9414ad1..6db61ea4 100644 --- a/server/database.js +++ b/server/database.js @@ -12,6 +12,10 @@ class Database { static sqliteInstance = null; static async connect() { + if (! fs.existsSync(this.dataDir)) { + fs.mkdirSync(this.dataDir, { recursive: true }); + } + const acquireConnectionTimeout = 120 * 1000; R.setup("sqlite", {