Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: empty scheduler job #565

Merged
merged 2 commits into from
Aug 19, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions scheduler/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,14 @@ func (s *Server) Serve() error {
}()

// Serve Job
go func() {
if err := s.job.Serve(); err != nil {
logger.Fatalf("job start failed %v", err)
}
logger.Info("job start successfully")
}()
if s.job != nil {
go func() {
if err := s.job.Serve(); err != nil {
logger.Fatalf("job start failed %v", err)
}
logger.Info("job start successfully")
}()
}

// Serve Keepalive
if s.managerClient != nil {
Expand Down Expand Up @@ -226,9 +228,13 @@ func (s *Server) keepAlive(ctx context.Context) error {
}

func (s *Server) Stop() {
s.managerConn.Close()
if s.managerConn != nil {
s.managerConn.Close()
}
s.dynConfig.Stop()
s.schedulerService.Stop()
s.job.Stop()
if s.job != nil {
s.job.Stop()
}
rpc.StopServer()
}