mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-08-08 21:38:37 +08:00
Change some jsdoc rule to warn instead of error
This commit is contained in:
@@ -133,6 +133,9 @@ class Database {
|
||||
log.info("db", `Data Dir: ${Database.dataDir}`);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
static readDBConfig() {
|
||||
let dbConfig;
|
||||
|
||||
@@ -149,6 +152,9 @@ class Database {
|
||||
return dbConfig;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param dbConfig
|
||||
*/
|
||||
static writeDBConfig(dbConfig) {
|
||||
fs.writeFileSync(path.join(Database.dataDir, "db-config.json"), JSON.stringify(dbConfig, null, 4));
|
||||
}
|
||||
@@ -276,6 +282,10 @@ class Database {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param testMode
|
||||
* @param noLog
|
||||
*/
|
||||
static async initSQLite(testMode, noLog) {
|
||||
await R.exec("PRAGMA foreign_keys = ON");
|
||||
if (testMode) {
|
||||
@@ -301,6 +311,9 @@ class Database {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
static async initMariaDB() {
|
||||
log.debug("db", "Checking if MariaDB database exists...");
|
||||
|
||||
@@ -337,7 +350,6 @@ class Database {
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
static async rollbackLatestPatch() {
|
||||
@@ -628,6 +640,9 @@ class Database {
|
||||
await R.exec("VACUUM");
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
static sqlHourOffset() {
|
||||
if (this.dbConfig.client === "sqlite3") {
|
||||
return "DATETIME('now', ? || ' hours')";
|
||||
|
@@ -24,7 +24,6 @@ class EmbeddedMariaDB {
|
||||
started = false;
|
||||
|
||||
/**
|
||||
*
|
||||
* @returns {EmbeddedMariaDB}
|
||||
*/
|
||||
static getInstance() {
|
||||
@@ -34,6 +33,9 @@ class EmbeddedMariaDB {
|
||||
return EmbeddedMariaDB.instance;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
static hasInstance() {
|
||||
return !!EmbeddedMariaDB.instance;
|
||||
}
|
||||
@@ -100,6 +102,9 @@ class EmbeddedMariaDB {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
stop() {
|
||||
if (this.childProcess) {
|
||||
this.childProcess.kill("SIGINT");
|
||||
@@ -107,6 +112,9 @@ class EmbeddedMariaDB {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
initDB() {
|
||||
if (!fs.existsSync(this.mariadbDataDir)) {
|
||||
log.info("mariadb", `Embedded MariaDB: ${this.mariadbDataDir} is not found, create one now.`);
|
||||
@@ -137,6 +145,9 @@ class EmbeddedMariaDB {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
async initDBAfterStarted() {
|
||||
const connection = mysql.createConnection({
|
||||
socketPath: this.socketPath,
|
||||
|
@@ -291,6 +291,9 @@ class Monitor extends BeanModel {
|
||||
return JSON.parse(this.accepted_statuscodes_json);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
getGameDigGivenPortOnly() {
|
||||
return Boolean(this.gamedigGivenPortOnly);
|
||||
}
|
||||
|
@@ -23,6 +23,10 @@ class SetupDatabase {
|
||||
|
||||
server;
|
||||
|
||||
/**
|
||||
* @param args
|
||||
* @param server
|
||||
*/
|
||||
constructor(args, server) {
|
||||
this.server = server;
|
||||
|
||||
@@ -72,10 +76,17 @@ class SetupDatabase {
|
||||
return this.needSetup;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
isEnabledEmbeddedMariaDB() {
|
||||
return process.env.UPTIME_KUMA_ENABLE_EMBEDDED_MARIADB === "1";
|
||||
}
|
||||
|
||||
/**
|
||||
* @param hostname
|
||||
* @param port
|
||||
*/
|
||||
start(hostname, port) {
|
||||
return new Promise((resolve) => {
|
||||
const app = express();
|
||||
|
Reference in New Issue
Block a user