periodic scripts exeuction from leader master

This commit is contained in:
Chris Lu
2019-06-05 01:30:24 -07:00
parent b9e138713c
commit ede876cfdb
47 changed files with 337 additions and 225 deletions

View File

@@ -13,7 +13,7 @@ import (
)
func init() {
commands = append(commands, &commandVolumeFixReplication{})
Commands = append(Commands, &commandVolumeFixReplication{})
}
type commandVolumeFixReplication struct {
@@ -41,7 +41,7 @@ func (c *commandVolumeFixReplication) Help() string {
`
}
func (c *commandVolumeFixReplication) Do(args []string, commandEnv *commandEnv, writer io.Writer) (err error) {
func (c *commandVolumeFixReplication) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
takeAction := true
if len(args) > 0 && args[0] == "-n" {
@@ -50,7 +50,7 @@ func (c *commandVolumeFixReplication) Do(args []string, commandEnv *commandEnv,
var resp *master_pb.VolumeListResponse
ctx := context.Background()
err = commandEnv.masterClient.WithClient(ctx, func(client master_pb.SeaweedClient) error {
err = commandEnv.MasterClient.WithClient(ctx, func(client master_pb.SeaweedClient) error {
resp, err = client.VolumeList(ctx, &master_pb.VolumeListRequest{})
return err
})