mirror of https://github.com/tikv/client-java.git
Signed-off-by: marsishandsome <marsishandsome@gmail.com>
This commit is contained in:
parent
83fb5f4d46
commit
952627a18e
|
@ -542,6 +542,10 @@ public class TiSession implements AutoCloseable {
|
|||
if (metricsServer != null) {
|
||||
metricsServer.close();
|
||||
}
|
||||
|
||||
if (circuitBreaker != null) {
|
||||
circuitBreaker.close();
|
||||
}
|
||||
}
|
||||
|
||||
if (now) {
|
||||
|
|
|
@ -66,12 +66,6 @@ public class SmartRawKVClient implements RawKVClientBase {
|
|||
this.circuitBreaker = breaker;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() throws Exception {
|
||||
circuitBreaker.close();
|
||||
client.close();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void put(ByteString key, ByteString value) {
|
||||
callWithCircuitBreaker("put", () -> client.put(key, value));
|
||||
|
@ -268,6 +262,11 @@ public class SmartRawKVClient implements RawKVClientBase {
|
|||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() throws Exception {
|
||||
client.close();
|
||||
}
|
||||
|
||||
public interface Function1<T> {
|
||||
T apply();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue