mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-07-31 19:17:30 +08:00
filer conf: support json conf only
This commit is contained in:
parent
4c72482536
commit
5931a2f53f
@ -9,7 +9,6 @@ import (
|
|||||||
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
|
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
|
||||||
"github.com/chrislusf/seaweedfs/weed/util"
|
"github.com/chrislusf/seaweedfs/weed/util"
|
||||||
"github.com/golang/protobuf/jsonpb"
|
"github.com/golang/protobuf/jsonpb"
|
||||||
"github.com/golang/protobuf/proto"
|
|
||||||
"github.com/viant/ptrie"
|
"github.com/viant/ptrie"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -61,15 +60,7 @@ func (fc *FilerConf) LoadFromBytes(data []byte) (err error) {
|
|||||||
conf := &filer_pb.FilerConf{}
|
conf := &filer_pb.FilerConf{}
|
||||||
|
|
||||||
if err := jsonpb.Unmarshal(bytes.NewReader(data), conf); err != nil {
|
if err := jsonpb.Unmarshal(bytes.NewReader(data), conf); err != nil {
|
||||||
|
return err
|
||||||
err = proto.UnmarshalText(string(data), conf)
|
|
||||||
if err != nil {
|
|
||||||
glog.Errorf("unable to parse filer conf: %v", err)
|
|
||||||
// this is not recoverable
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return fc.doLoadConf(conf)
|
return fc.doLoadConf(conf)
|
||||||
|
Loading…
Reference in New Issue
Block a user