Commit cd95eb12 authored by Vladimir Barsukov's avatar Vladimir Barsukov
Browse files

add IsAlive

parent 4a280852
......@@ -178,10 +178,8 @@ func (d *Pool) ping(q *conn) (err error) {
var n any
if err = d.qGet(q, &n, "SELECT 1"); err != nil {
d.logger.Printf("DB_PING_ERR: MODE: %v, HOST: %s, PORT: %d, ERR: %v",
q.Mode.String(),
q.Config().ConnConfig.Host,
q.Config().ConnConfig.Port,
d.logger.Printf("DB_PING_ERR: SRV: %s; %v",
q.ToString(),
err,
)
}
......@@ -247,6 +245,10 @@ func (d *Pool) Stop() {
d.stop = true
}
func (d *Pool) IsAlive() bool {
return d.srvMaster.Alive
}
func (d *Pool) prepare(sql string, param map[string]any) string {
for n, t := range param {
switch t.(type) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment