Adding interval configuration to stop command.
This commit is contained in:
parent
51daad88eb
commit
09469f3216
1 changed files with 5 additions and 3 deletions
|
@ -13,6 +13,8 @@ func init() {
|
||||||
|
|
||||||
// Stop subcommands
|
// Stop subcommands
|
||||||
stopCmd.AddCommand(stopMaintCmd)
|
stopCmd.AddCommand(stopMaintCmd)
|
||||||
|
stopMaintCmd.Flags().IntVar(&monitorInterval,"interval", 5, "Interval at which to poll scheduler.")
|
||||||
|
stopMaintCmd.Flags().IntVar(&monitorTimeout,"timeout", 50, "Time after which the monitor will stop polling and throw an error.")
|
||||||
}
|
}
|
||||||
|
|
||||||
var stopCmd = &cobra.Command{
|
var stopCmd = &cobra.Command{
|
||||||
|
@ -40,8 +42,8 @@ func endMaintenance(cmd *cobra.Command, args []string) {
|
||||||
hostResult, err := monitor.HostMaintenance(
|
hostResult, err := monitor.HostMaintenance(
|
||||||
args,
|
args,
|
||||||
[]aurora.MaintenanceMode{aurora.MaintenanceMode_NONE},
|
[]aurora.MaintenanceMode{aurora.MaintenanceMode_NONE},
|
||||||
5,
|
monitorInterval,
|
||||||
10)
|
monitorTimeout)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
for host, ok := range hostResult {
|
for host, ok := range hostResult {
|
||||||
if !ok {
|
if !ok {
|
||||||
|
@ -53,5 +55,5 @@ func endMaintenance(cmd *cobra.Command, args []string) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Print(result.String())
|
fmt.Println(result.String())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue