mirror of
https://github.com/gusaul/grpcox.git
synced 2024-12-25 09:50:10 +00:00
add timeout cancelation connection
This commit is contained in:
parent
c3cb947507
commit
37d525bcb8
|
@ -165,13 +165,24 @@ func (r *Resource) Invoke(ctx context.Context, symbol string, in io.Reader) (str
|
||||||
|
|
||||||
// Close - to close all resources that was opened before
|
// Close - to close all resources that was opened before
|
||||||
func (r *Resource) Close() {
|
func (r *Resource) Close() {
|
||||||
if r.refClient != nil {
|
done := make(chan int)
|
||||||
r.refClient.Reset()
|
go func() {
|
||||||
r.refClient = nil
|
if r.refClient != nil {
|
||||||
}
|
r.refClient.Reset()
|
||||||
if r.clientConn != nil {
|
r.refClient = nil
|
||||||
r.clientConn.Close()
|
}
|
||||||
r.clientConn = nil
|
if r.clientConn != nil {
|
||||||
|
r.clientConn.Close()
|
||||||
|
r.clientConn = nil
|
||||||
|
}
|
||||||
|
done <- 1
|
||||||
|
}()
|
||||||
|
|
||||||
|
select {
|
||||||
|
case <-done:
|
||||||
|
return
|
||||||
|
case <-time.After(3 * time.Second):
|
||||||
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -248,7 +248,8 @@ function refreshConnCount() {
|
||||||
|
|
||||||
function refreshToolTip() {
|
function refreshToolTip() {
|
||||||
$(function () {
|
$(function () {
|
||||||
$('[data-toggle="tooltip"]').tooltip()
|
$('[data-toggle="tooltip"]').tooltip('dispose');
|
||||||
|
$('[data-toggle="tooltip"]').tooltip();
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user