Skip to content

Commit

Permalink
fix(hatchery:k8s): watch events routine auto restart (#6539)
Browse files Browse the repository at this point in the history
Signed-off-by: richardlt <[email protected]>
  • Loading branch information
richardlt authored Apr 20, 2023
1 parent 17ec69d commit cfc9eb4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion engine/hatchery/kubernetes/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func (h *HatcheryKubernetes) InitHatchery(ctx context.Context) error {
h.routines(ctx)
})

h.GoRoutines.Run(ctx, "hatchery kubernetes watcher", func(ctx context.Context) {
h.GoRoutines.RunWithRestart(ctx, "hatchery kubernetes watcher", func(ctx context.Context) {
if err := h.WatchPodEvents(ctx); err != nil {
log.ErrorWithStackTrace(ctx, err)
}
Expand Down
1 change: 1 addition & 0 deletions engine/worker/cmd_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ func runCmd() func(cmd *cobra.Command, args []string) {
go func() {
select {
case <-c:
log.Info(ctx, "Received syscall.SIGTERM")
cancel()
return
case <-ctx.Done():
Expand Down

0 comments on commit cfc9eb4

Please sign in to comment.