Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

minor adjustments

Chris Lu152a6cbc2b1b
diff --git a/weed/topology/topology.go b/weed/topology/topology.go
index f93d2179c6..a11a1bac69 100644
--- a/weed/topology/topology.go
+++ b/weed/topology/topology.go
@@ -72,8 +72,7 @@ func (t *Topology) IsLeader() bool {
func (t *Topology) Leader() (string, error) {
l := ""
- count := 3
- for count > 0 {
+ for count := 0; count < 3; count++ {
if t.RaftServer != nil {
l = t.RaftServer.Leader()
} else {
@@ -82,15 +81,14 @@ func (t *Topology) Leader() (string, error) {
if l != "" {
break
} else {
- time.Sleep(time.Duration(5-count) * time.Second)
+ time.Sleep(time.Duration(5+count) * time.Second)
}
- count -= 1
}
return l, nil
}
func (t *Topology) Lookup(collection string, vid needle.VolumeId) (dataNodes []*DataNode) {
- //maybe an issue if lots of collections?
+ // maybe an issue if lots of collections?
if collection == "" {
for _, c := range t.collectionMap.Items() {
if list := c.(*Collection).Lookup(vid); list != nil {