Skip to content

Commit

Permalink
Use workqueue for scheduler (#194)
Browse files Browse the repository at this point in the history
  • Loading branch information
tamalsaha committed Oct 10, 2017
1 parent 2719cbd commit e28c13f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion schedule.go
Expand Up @@ -28,6 +28,7 @@ func NewCmdSchedule() *cobra.Command {
PushgatewayURL: "http://stash-operator.kube-system.svc:56789",
PodLabelsPath: "/etc/stash/labels",
ResyncPeriod: 5 * time.Minute,
MaxNumRequeues: 5,
}
)

Expand Down Expand Up @@ -115,7 +116,12 @@ func NewCmdSchedule() *cobra.Command {
if err != nil {
log.Fatalf("Failed to setup scheduler: %s", err)
}
ctrl.RunAndHold()
stop := make(chan struct{})
defer close(stop)
go ctrl.Run(1, stop)

// Wait forever
select {}
},
}
cmd.Flags().StringVar(&masterURL, "master", masterURL, "The address of the Kubernetes API server (overrides any value in kubeconfig)")
Expand Down

0 comments on commit e28c13f

Please sign in to comment.