Skip to content

Commit

Permalink
Update index.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
bobslavtriev authored May 15, 2024
1 parent 6d14f82 commit ac14acd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Mysql/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { MySQLConfig, sqlData, sqlConnection, AuthenticationCreds } from '../Typ
*/

let conn: sqlConnection
let pending: boolean = true
let pending: boolean | undefined
let taskKeepAlive: NodeJS.Timeout | undefined
const DEFAULT_TABLE_NAME = 'auth';

Expand Down Expand Up @@ -73,7 +73,7 @@ export const useMySQLAuthState = async(config: MySQLConfig): Promise<{ state: ob

taskKeepAlive = setInterval(async () => {
await conn.ping().catch(async () => await reconnect())
if (!!conn?.connection?._closing){
if (conn?.connection?._closing){
await reconnect()
}
}, keepAliveIntervalMs)
Expand Down

0 comments on commit ac14acd

Please sign in to comment.