Documentation ¶
Index ¶
- Constants
- Variables
- func GenerateNextStartDateTime(now time.Time, nextStartTime time.Time) *time.Time
- type DailyScheduler
- type JobServer
- func (srv *JobServer) CancellationWatcher(ctx context.Context, jobId string, cancelChan chan struct{})
- func (srv *JobServer) CheckForPendingJobsByType(jobType string) (bool, *model.AppError)
- func (srv *JobServer) ClaimJob(job *model.Job) (bool, *model.AppError)
- func (srv *JobServer) Config() *model.Config
- func (srv *JobServer) CreateJob(jobType string, jobData map[string]string) (*model.Job, *model.AppError)
- func (srv *JobServer) GetJob(id string) (*model.Job, *model.AppError)
- func (srv *JobServer) GetJobsByTypeAndStatus(jobType string, status string) ([]*model.Job, *model.AppError)
- func (srv *JobServer) GetLastSuccessfulJobByType(jobType string) (*model.Job, *model.AppError)
- func (srv *JobServer) HandleClusterLeaderChange(isLeader bool)
- func (srv *JobServer) MakeWatcher(workers *Workers, pollingInterval int) *Watcher
- func (srv *JobServer) RegisterJobType(name string, worker model.Worker, scheduler model.Scheduler)
- func (srv *JobServer) RequestCancellation(jobId string) *model.AppError
- func (srv *JobServer) SetJobCanceled(job *model.Job) *model.AppError
- func (srv *JobServer) SetJobError(job *model.Job, jobError *model.AppError) *model.AppError
- func (srv *JobServer) SetJobPending(job *model.Job) *model.AppError
- func (srv *JobServer) SetJobProgress(job *model.Job, progress int64) *model.AppError
- func (srv *JobServer) SetJobSuccess(job *model.Job) *model.AppError
- func (srv *JobServer) SetJobWarning(job *model.Job) *model.AppError
- func (srv *JobServer) StartSchedulers() error
- func (srv *JobServer) StartWorkers() error
- func (srv *JobServer) StopSchedulers() error
- func (srv *JobServer) StopWorkers() error
- func (srv *JobServer) UpdateInProgressJobData(job *model.Job) *model.AppError
- type PeriodicScheduler
- func (scheduler *PeriodicScheduler) Enabled(cfg *model.Config) bool
- func (scheduler *PeriodicScheduler) NextScheduleTime(_ *model.Config, _ time.Time, _ bool, _ *model.Job) *time.Time
- func (scheduler *PeriodicScheduler) ScheduleJob(_ *model.Config, _ bool, _ *model.Job) (*model.Job, *model.AppError)
- type Schedulers
- type SimpleWorker
- type Watcher
- type Workers
Constants ¶
View Source
const (
CancelWatcherPollingInterval = 5000
)
Variables ¶
View Source
var ( ErrSchedulersNotRunning = errors.New("job schedulers are not running") ErrSchedulersRunning = errors.New("job schedulers are running") ErrSchedulersUninitialized = errors.New("job schedulers are not initialized") )
View Source
var ( ErrWorkersNotRunning = errors.New("job workers are not running") ErrWorkersRunning = errors.New("job workers are running") ErrWorkersUninitialized = errors.New("job workers are not initialized") )
View Source
var DefaultWatcherPollingInterval = 15000
Default polling interval for jobs termination. (Defining as `var` rather than `const` allows tests to lower the interval.)
Functions ¶
Types ¶
type DailyScheduler ¶
type DailyScheduler struct {
// contains filtered or unexported fields
}
func NewDailyScheduler ¶
func (*DailyScheduler) NextScheduleTime ¶
type JobServer ¶
type JobServer struct { ConfigService configservice.ConfigService Store store.Store // contains filtered or unexported fields }
func NewJobServer ¶
func NewJobServer(configService configservice.ConfigService, store store.Store, metrics einterfaces.MetricsInterface) *JobServer
func (*JobServer) CancellationWatcher ¶
func (*JobServer) CheckForPendingJobsByType ¶
func (*JobServer) GetJobsByTypeAndStatus ¶
func (*JobServer) GetLastSuccessfulJobByType ¶
func (*JobServer) HandleClusterLeaderChange ¶
func (*JobServer) MakeWatcher ¶
func (*JobServer) RegisterJobType ¶
func (*JobServer) RequestCancellation ¶
func (*JobServer) SetJobCanceled ¶
func (*JobServer) SetJobError ¶
func (*JobServer) SetJobPending ¶
func (*JobServer) SetJobProgress ¶
func (*JobServer) SetJobSuccess ¶
func (*JobServer) SetJobWarning ¶
func (*JobServer) StartSchedulers ¶
func (*JobServer) StartWorkers ¶
func (*JobServer) StopSchedulers ¶
func (*JobServer) StopWorkers ¶
type PeriodicScheduler ¶
type PeriodicScheduler struct {
// contains filtered or unexported fields
}
func NewPeriodicScheduler ¶
func (*PeriodicScheduler) Enabled ¶
func (scheduler *PeriodicScheduler) Enabled(cfg *model.Config) bool
func (*PeriodicScheduler) NextScheduleTime ¶
type Schedulers ¶
type Schedulers struct {
// contains filtered or unexported fields
}
func (*Schedulers) AddScheduler ¶
func (schedulers *Schedulers) AddScheduler(name string, scheduler model.Scheduler)
func (*Schedulers) Start ¶
func (schedulers *Schedulers) Start()
Start starts the schedulers. This call is not safe for concurrent use. Synchronization should be implemented by the caller.
func (*Schedulers) Stop ¶
func (schedulers *Schedulers) Stop()
Stop stops the schedulers. This call is not safe for concurrent use. Synchronization should be implemented by the caller.
type SimpleWorker ¶
type SimpleWorker struct {
// contains filtered or unexported fields
}
func NewSimpleWorker ¶
func (*SimpleWorker) DoJob ¶
func (worker *SimpleWorker) DoJob(job *model.Job)
func (*SimpleWorker) JobChannel ¶
func (worker *SimpleWorker) JobChannel() chan<- model.Job
func (*SimpleWorker) Run ¶
func (worker *SimpleWorker) Run()
func (*SimpleWorker) Stop ¶
func (worker *SimpleWorker) Stop()
type Watcher ¶
type Watcher struct {
// contains filtered or unexported fields
}
func (*Watcher) PollAndNotify ¶
func (watcher *Watcher) PollAndNotify()
type Workers ¶
type Workers struct { ConfigService configservice.ConfigService Watcher *Watcher // contains filtered or unexported fields }
func NewWorkers ¶
func NewWorkers(configService configservice.ConfigService) *Workers
Source Files ¶
Click to show internal directories.
Click to hide internal directories.