create data dir if not exists

This commit is contained in:
LouisLam 2021-09-02 20:42:55 +08:00
parent 3ee13bddd1
commit b604807cfe

View file

@ -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", {