mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-28 20:21:47 +00:00
upgrades to debora/barak to allow shutting down barak
This commit is contained in:
@ -106,12 +106,12 @@ func main() {
|
||||
},
|
||||
cli.Command{
|
||||
Name: "open",
|
||||
Usage: "open listener",
|
||||
Usage: "open barak listener",
|
||||
Action: cliOpenListener,
|
||||
},
|
||||
cli.Command{
|
||||
Name: "close",
|
||||
Usage: "close listener",
|
||||
Usage: "close barka listener",
|
||||
Action: cliCloseListener,
|
||||
},
|
||||
cli.Command{
|
||||
@ -119,6 +119,11 @@ func main() {
|
||||
Usage: "download file <remote-path> <local-path-prefix>",
|
||||
Action: cliDownloadFile,
|
||||
},
|
||||
cli.Command{
|
||||
Name: "quit",
|
||||
Usage: "quit barak",
|
||||
Action: cliQuit,
|
||||
},
|
||||
}
|
||||
app.Run(os.Args)
|
||||
}
|
||||
@ -330,3 +335,21 @@ func cliDownloadFile(c *cli.Context) {
|
||||
}
|
||||
wg.Wait()
|
||||
}
|
||||
|
||||
func cliQuit(c *cli.Context) {
|
||||
command := btypes.CommandQuit{}
|
||||
wg := sync.WaitGroup{}
|
||||
for _, remote := range Config.Remotes {
|
||||
wg.Add(1)
|
||||
go func(remote string) {
|
||||
defer wg.Done()
|
||||
response, err := Quit(Config.PrivKey, remote, command)
|
||||
if err != nil {
|
||||
fmt.Printf("%v failure. %v\n", remote, err)
|
||||
} else {
|
||||
fmt.Printf("%v success. %v\n", remote, response)
|
||||
}
|
||||
}(remote)
|
||||
}
|
||||
wg.Wait()
|
||||
}
|
||||
|
Reference in New Issue
Block a user