mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-12-24 23:09:39 -05:00
create data dir before copy
This commit is contained in:
parent
6e3e2fc85c
commit
582e14098d
@ -12,10 +12,6 @@ class Database {
|
|||||||
static sqliteInstance = null;
|
static sqliteInstance = null;
|
||||||
|
|
||||||
static async connect() {
|
static async connect() {
|
||||||
if (! fs.existsSync(this.dataDir)) {
|
|
||||||
fs.mkdirSync(this.dataDir, { recursive: true });
|
|
||||||
}
|
|
||||||
|
|
||||||
const acquireConnectionTimeout = 120 * 1000;
|
const acquireConnectionTimeout = 120 * 1000;
|
||||||
|
|
||||||
R.setup("sqlite", {
|
R.setup("sqlite", {
|
||||||
|
@ -53,6 +53,9 @@ const sslCert = process.env.SSL_CERT || args["ssl-cert"] || undefined;
|
|||||||
// Data Directory (must be end with "/")
|
// Data Directory (must be end with "/")
|
||||||
Database.dataDir = process.env.DATA_DIR || args["data-dir"] || "./data/";
|
Database.dataDir = process.env.DATA_DIR || args["data-dir"] || "./data/";
|
||||||
Database.path = Database.dataDir + "kuma.db";
|
Database.path = Database.dataDir + "kuma.db";
|
||||||
|
if (! fs.existsSync(this.dataDir)) {
|
||||||
|
fs.mkdirSync(this.dataDir, { recursive: true });
|
||||||
|
}
|
||||||
console.log(`Data Dir: ${Database.dataDir}`);
|
console.log(`Data Dir: ${Database.dataDir}`);
|
||||||
|
|
||||||
console.log("Creating express and socket.io instance")
|
console.log("Creating express and socket.io instance")
|
||||||
|
Loading…
Reference in New Issue
Block a user