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
4a21e5bf
Commit
4a21e5bf
authored
May 22, 2023
by
Vladimir Barsukov
Browse files
fix
parent
8666da65
Changes
2
Hide whitespace changes
Inline
Side-by-side
pool.go
View file @
4a21e5bf
...
@@ -265,7 +265,9 @@ func (d *Pool) Start() {
...
@@ -265,7 +265,9 @@ func (d *Pool) Start() {
}
}
}
}
d
.
srvMaster
.
Alive
=
d
.
ping
(
d
.
srvMaster
)
==
nil
if
d
.
srvMaster
!=
nil
{
d
.
srvMaster
.
Alive
=
d
.
ping
(
d
.
srvMaster
)
==
nil
}
time
.
Sleep
(
time
.
Second
)
time
.
Sleep
(
time
.
Second
)
}
}
...
@@ -277,7 +279,7 @@ func (d *Pool) Stop() {
...
@@ -277,7 +279,7 @@ func (d *Pool) Stop() {
}
}
func
(
d
*
Pool
)
IsAlive
()
bool
{
func
(
d
*
Pool
)
IsAlive
()
bool
{
return
d
.
srvMaster
.
Alive
return
d
.
srvMaster
!=
nil
&&
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
{
...
...
stats.go
View file @
4a21e5bf
...
@@ -34,7 +34,11 @@ func (d *Pool) StatPool() []*Stat {
...
@@ -34,7 +34,11 @@ func (d *Pool) StatPool() []*Stat {
out
=
append
(
out
,
d
.
stat
(
q
))
out
=
append
(
out
,
d
.
stat
(
q
))
}
}
return
append
(
out
,
d
.
stat
(
d
.
srvMaster
))
if
d
.
srvMaster
!=
nil
{
return
append
(
out
,
d
.
stat
(
d
.
srvMaster
))
}
return
out
}
}
func
(
d
*
Pool
)
StatPoolTotal
()
*
Stat
{
func
(
d
*
Pool
)
StatPoolTotal
()
*
Stat
{
...
...
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