From 8ea740978fe6b35cc0d46285baf180ba7d114a6b Mon Sep 17 00:00:00 2001 From: chrislu Date: Wed, 15 Oct 2025 23:17:06 -0700 Subject: [PATCH] fmt --- weed/mq/broker/broker_topic_conf_read_write.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/weed/mq/broker/broker_topic_conf_read_write.go b/weed/mq/broker/broker_topic_conf_read_write.go index 80fd5d995..f02d2ac75 100644 --- a/weed/mq/broker/broker_topic_conf_read_write.go +++ b/weed/mq/broker/broker_topic_conf_read_write.go @@ -20,7 +20,7 @@ import ( func (b *MessageQueueBroker) GetOrGenerateLocalPartition(t topic.Topic, partition topic.Partition) (localTopicPartition *topic.LocalPartition, getOrGenError error) { // get or generate a local partition topicKey := t.String() - + // Check cache first to avoid expensive filer reads (60% CPU overhead!) b.topicConfCacheMu.RLock() if entry, found := b.topicConfCache[topicKey]; found { @@ -37,7 +37,7 @@ func (b *MessageQueueBroker) GetOrGenerateLocalPartition(t topic.Topic, partitio } } b.topicConfCacheMu.RUnlock() - + // Cache miss or expired - read from filer glog.V(4).Infof("TopicConf cache MISS for %s, reading from filer", topicKey) conf, readConfErr := b.fca.ReadTopicConfFromFiler(t) @@ -45,7 +45,7 @@ func (b *MessageQueueBroker) GetOrGenerateLocalPartition(t topic.Topic, partitio glog.Errorf("topic %v not found: %v", t, readConfErr) return nil, fmt.Errorf("topic %v not found: %w", t, readConfErr) } - + // Cache the result b.topicConfCacheMu.Lock() b.topicConfCache[topicKey] = &topicConfCacheEntry{