Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Vladimir Barsukov
zdb
Commits
cd95eb12
Commit
cd95eb12
authored
May 21, 2023
by
Vladimir Barsukov
Browse files
add IsAlive
parent
4a280852
Changes
1
Hide whitespace changes
Inline
Side-by-side
pool.go
View file @
cd95eb12
...
@@ -178,10 +178,8 @@ func (d *Pool) ping(q *conn) (err error) {
...
@@ -178,10 +178,8 @@ func (d *Pool) ping(q *conn) (err error) {
var
n
any
var
n
any
if
err
=
d
.
qGet
(
q
,
&
n
,
"SELECT 1"
);
err
!=
nil
{
if
err
=
d
.
qGet
(
q
,
&
n
,
"SELECT 1"
);
err
!=
nil
{
d
.
logger
.
Printf
(
"DB_PING_ERR: MODE: %v, HOST: %s, PORT: %d, ERR: %v"
,
d
.
logger
.
Printf
(
"DB_PING_ERR: SRV: %s; %v"
,
q
.
Mode
.
String
(),
q
.
ToString
(),
q
.
Config
()
.
ConnConfig
.
Host
,
q
.
Config
()
.
ConnConfig
.
Port
,
err
,
err
,
)
)
}
}
...
@@ -247,6 +245,10 @@ func (d *Pool) Stop() {
...
@@ -247,6 +245,10 @@ func (d *Pool) Stop() {
d
.
stop
=
true
d
.
stop
=
true
}
}
func
(
d
*
Pool
)
IsAlive
()
bool
{
return
d
.
srvMaster
.
Alive
}
func
(
d
*
Pool
)
prepare
(
sql
string
,
param
map
[
string
]
any
)
string
{
func
(
d
*
Pool
)
prepare
(
sql
string
,
param
map
[
string
]
any
)
string
{
for
n
,
t
:=
range
param
{
for
n
,
t
:=
range
param
{
switch
t
.
(
type
)
{
switch
t
.
(
type
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment