Skip to content

Commit

Permalink
🐛 config's TrackerServers to Tracker
Browse files Browse the repository at this point in the history
  • Loading branch information
smally84 committed Nov 12, 2020
1 parent ef588e8 commit 086d217
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions internal/app/dfs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func TestDfs(t *testing.T) {
config2.Storage.HTTPScheme = "http"
config2.Storage.Group = "group1"
config2.Storage.StoragePath = "./dfs/1"
config2.Storage.TrackerServers = []string{"http://127.0.0.1:9000"}
config2.Storage.Tracker = []string{"http://127.0.0.1:9000"}
go Start(&config2)

// 启动storage
Expand All @@ -40,7 +40,7 @@ func TestDfs(t *testing.T) {
config3.Storage.HTTPScheme = "http"
config3.Storage.Group = "group1"
config3.Storage.StoragePath = "./dfs/2"
config3.Storage.TrackerServers = []string{"http://127.0.0.1:9000"}
config3.Storage.Tracker = []string{"http://127.0.0.1:9000"}
go Start(&config3)

<-make(chan bool)
Expand Down
4 changes: 2 additions & 2 deletions internal/app/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ func (s *Storage) ReportStatus() {
}
// 获取容量信息
// 获取负载信息
for _, url := range s.ServerConfig.Storage.TrackerServers {
for _, url := range s.ServerConfig.Storage.Tracker {
pkg.Helper{}.PostJSON(url+"/report-status", data, nil, 10*time.Second)
}
}
Expand All @@ -200,7 +200,7 @@ func (s *Storage) ReportErrorMsg(msg string) {
Port string
Msg string
}
for _, url := range s.ServerConfig.Storage.TrackerServers {
for _, url := range s.ServerConfig.Storage.Tracker {
pkg.Helper{}.PostJSON(url+"/report-err",
errMsg{
Group: s.ServerConfig.Storage.Group,
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type DsfConfigType struct {
// storagePath
StoragePath string `mapstructure:"storage_path"`
// trackerServers,can be one or more
TrackerServers []string `mapstructure:"tracker_servers"`
Tracker []string `mapstructure:"tracker"`
} `mapstructure:"storage"`
}

Expand Down

0 comments on commit 086d217

Please sign in to comment.