mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-08-09 11:58:02 +08:00
chore(jsdoc):Linting fixes (#3703)
* fixed the lockfile having a different version * jsdoc
This commit is contained in:
@@ -134,7 +134,10 @@ class Database {
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Read the database config
|
||||
* @throws {Error} If the config is invalid
|
||||
* @typedef {string|undefined} envString
|
||||
* @returns {{type: "sqlite"} | {type:envString, hostname:envString, port:envString, database:envString, username:envString, password:envString}} Database config
|
||||
*/
|
||||
static readDBConfig() {
|
||||
let dbConfig;
|
||||
@@ -153,7 +156,9 @@ class Database {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param dbConfig
|
||||
* @typedef {string|undefined} envString
|
||||
* @param {{type: "sqlite"} | {type:envString, hostname:envString, port:envString, database:envString, username:envString, password:envString}} dbConfig the database configuration that should be written
|
||||
* @returns {void}
|
||||
*/
|
||||
static writeDBConfig(dbConfig) {
|
||||
fs.writeFileSync(path.join(Database.dataDir, "db-config.json"), JSON.stringify(dbConfig, null, 4));
|
||||
@@ -161,10 +166,8 @@ class Database {
|
||||
|
||||
/**
|
||||
* Connect to the database
|
||||
* @param {boolean} testMode Should the connection be
|
||||
* started in test mode?
|
||||
* @param {boolean} autoloadModels Should models be
|
||||
* automatically loaded?
|
||||
* @param {boolean} testMode Should the connection be started in test mode?
|
||||
* @param {boolean} autoloadModels Should models be automatically loaded?
|
||||
* @param {boolean} noLog Should logs not be output?
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
@@ -292,8 +295,9 @@ class Database {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param testMode
|
||||
* @param noLog
|
||||
@param {boolean} testMode Should the connection be started in test mode?
|
||||
@param {boolean} noLog Should logs not be output?
|
||||
@returns {Promise<void>}
|
||||
*/
|
||||
static async initSQLite(testMode, noLog) {
|
||||
await R.exec("PRAGMA foreign_keys = ON");
|
||||
@@ -321,7 +325,8 @@ class Database {
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Initialize MariaDB
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
static async initMariaDB() {
|
||||
log.debug("db", "Checking if MariaDB database exists...");
|
||||
@@ -368,6 +373,7 @@ class Database {
|
||||
|
||||
/**
|
||||
* Patch the database for SQLite
|
||||
* @returns {Promise<void>}
|
||||
* @deprecated
|
||||
*/
|
||||
static async patchSqlite() {
|
||||
@@ -650,7 +656,7 @@ class Database {
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @returns {string} Get the SQL for the current time plus a number of hours
|
||||
*/
|
||||
static sqlHourOffset() {
|
||||
if (Database.dbConfig.type === "sqlite") {
|
||||
|
Reference in New Issue
Block a user