File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
api/src/main/java/io/kafbat/ui/service Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 22
33import io .kafbat .ui .model .InternalPartitionsOffsets ;
44import io .kafbat .ui .model .KafkaCluster ;
5+ import io .kafbat .ui .model .ServerStatusDTO ;
56import io .kafbat .ui .model .Statistics ;
67import java .util .List ;
78import java .util .Map ;
89import java .util .Objects ;
910import java .util .concurrent .ConcurrentHashMap ;
11+ import lombok .extern .slf4j .Slf4j ;
1012import org .apache .kafka .clients .admin .ConfigEntry ;
1113import org .apache .kafka .clients .admin .TopicDescription ;
1214import org .springframework .stereotype .Component ;
1315
16+ @ Slf4j
1417@ Component
1518public class StatisticsCache {
1619
@@ -34,6 +37,13 @@ public synchronized void update(KafkaCluster c,
3437 c ,
3538 stats .withClusterState (s -> s .updateTopics (descriptions , configs , partitionsOffsets ))
3639 );
40+ try {
41+ if (!stats .getStatus ().equals (ServerStatusDTO .INITIALIZING )) {
42+ stats .close ();
43+ }
44+ } catch (Exception e ) {
45+ log .error ("Error closing cluster {} stats" , c .getName (), e );
46+ }
3747 }
3848
3949 public synchronized void onTopicDelete (KafkaCluster c , String topic ) {
You can’t perform that action at this time.
0 commit comments