Skip to content

Commit 32456d3

Browse files
committed
fix: address the comment
1 parent 9437d25 commit 32456d3

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

server/monitor-types/mysql.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const { MonitorType } = require("./monitor-type");
2-
const { log, UP } = require("../../src/util");
2+
const { UP } = require("../../src/util");
33
const dayjs = require("dayjs");
44
const mysql = require("mysql2");
55
const { ConditionVariable } = require("../monitor-conditions/variables");
@@ -19,8 +19,6 @@ class MysqlMonitorType extends MonitorType {
1919
* @inheritdoc
2020
*/
2121
async check(monitor, heartbeat, _server) {
22-
let startTime = dayjs().valueOf();
23-
2422
let query = monitor.databaseQuery;
2523
if (!query || (typeof query === "string" && query.trim() === "")) {
2624
query = "SELECT 1";
@@ -33,6 +31,7 @@ class MysqlMonitorType extends MonitorType {
3331
const conditions = ConditionExpressionGroup.fromMonitor(monitor);
3432
const hasConditions = conditions && conditions.length > 0;
3533

34+
const startTime = dayjs().valueOf();
3635
try {
3736
if (hasConditions) {
3837
// When conditions are enabled, expect a single value result

0 commit comments

Comments
 (0)