mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-10-30 17:00:48 +01:00
handle missing leading zero padding in replica
This commit is contained in:
1 parent
e3fa87bcc1
commit
7dd480acad
1 file changed
+8
@@ -12,6 +12,14 @@ type ReplicaPlacement struct {
|
||||
|
||||
func NewReplicaPlacementFromString(t string) (*ReplicaPlacement, error) {
|
||||
rp := &ReplicaPlacement{}
|
||||
switch len(t) {
|
||||
case 0:
|
||||
t = "000"
|
||||
case 1:
|
||||
t = "00" + t
|
||||
case 2:
|
||||
t = "0" + t
|
||||
}
|
||||
for i, c := range t {
|
||||
count := int(c - '0')
|
||||
if count < 0 {
|
||||
|
||||
Reference in new issue
Block a user