sector index: Don't add duplicate storage URLs
This commit is contained in:
parent
5e4a7e54df
commit
cb1e7bd1b1
@ -104,7 +104,17 @@ func (i *Index) StorageAttach(ctx context.Context, si StorageInfo, st FsStat) er
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
i.stores[si.ID].info.URLs = append(i.stores[si.ID].info.URLs, si.URLs...)
|
uloop:
|
||||||
|
for _, u := range si.URLs {
|
||||||
|
for _, l := range i.stores[si.ID].info.URLs {
|
||||||
|
if u == l {
|
||||||
|
continue uloop
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
i.stores[si.ID].info.URLs = append(i.stores[si.ID].info.URLs, u)
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
i.stores[si.ID] = &storageEntry{
|
i.stores[si.ID] = &storageEntry{
|
||||||
@ -127,7 +137,7 @@ func (i *Index) StorageDeclareSector(ctx context.Context, storageId ID, s abi.Se
|
|||||||
|
|
||||||
for _, sid := range i.sectors[d] {
|
for _, sid := range i.sectors[d] {
|
||||||
if sid == storageId {
|
if sid == storageId {
|
||||||
log.Warnf("sector %v redeclared in %s", storageId)
|
log.Warnf("sector %v redeclared in %s", s, storageId)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user