Documentation ¶
Overview ¶
Package dispatch provides a service to dispatch jobs to the runner.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckJobStatus ¶
CheckJobStatus checks the ability to transit from old to target status. It's only used for job status transition.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) Dispatch ¶
func (s *Service) Dispatch(ctx context.Context, jobs []*db.Job, executions []*db.JobExecution) error
Dispatch dispatches the jobs and updates the job executions. It pushes the jobs to the queue if all the dependencies are completed and success. TODO: proceed dispatch if one job is failed, all the dependent jobs should be skipped.
func (*Service) UpdateJobExecution ¶
func (s *Service) UpdateJobExecution(ctx context.Context, client *db.Client, option *db.UpdateJobExecutionOption) error
UpdateJobExecution updates job execution status and job queue status. It insert a new job queue if the job execution status is queued.
Click to show internal directories.
Click to hide internal directories.