File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change 11const { MonitorType } = require ( "./monitor-type" ) ;
2- const { log , UP } = require ( "../../src/util" ) ;
2+ const { UP } = require ( "../../src/util" ) ;
33const dayjs = require ( "dayjs" ) ;
44const mysql = require ( "mysql2" ) ;
55const { 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
You can’t perform that action at this time.
0 commit comments