mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-12-28 06:59:42 -08:00
Fix #2777
This commit is contained in:
parent
aad087caac
commit
d1175ff471
|
@ -292,6 +292,12 @@ exports.postgresQuery = function (connectionString, query) {
|
|||
client.end();
|
||||
} else {
|
||||
// Connected here
|
||||
try {
|
||||
// No query provided by user, use SELECT 1
|
||||
if (!query || (typeof query === "string" && query.trim() === "")) {
|
||||
query = "SELECT 1";
|
||||
}
|
||||
|
||||
client.query(query, (err, res) => {
|
||||
if (err) {
|
||||
reject(err);
|
||||
|
@ -300,6 +306,9 @@ exports.postgresQuery = function (connectionString, query) {
|
|||
}
|
||||
client.end();
|
||||
});
|
||||
} catch (e) {
|
||||
reject(e);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue