jobs

package
v4.9.0-rc1+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 5, 2018 License: AGPL-3.0, Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CANCEL_WATCHER_POLLING_INTERVAL = 5000
)

Variables

View Source
var DEFAULT_WATCHER_POLLING_INTERVAL = 15000

Default polling interval for jobs termination. (Defining as `var` rather than `const` allows tests to lower the interval.)

Functions

func GenerateNextStartDateTime

func GenerateNextStartDateTime(now time.Time, nextStartTime time.Time) *time.Time

Types

type ConfigService

type ConfigService interface {
	Config() *model.Config
	AddConfigListener(func(old, current *model.Config)) string
	RemoveConfigListener(string)
}

type JobServer

type JobServer struct {
	ConfigService ConfigService
	Store         store.Store
	Workers       *Workers
	Schedulers    *Schedulers

	DataRetentionJob        ejobs.DataRetentionJobInterface
	MessageExportJob        ejobs.MessageExportJobInterface
	ElasticsearchAggregator ejobs.ElasticsearchAggregatorInterface
	ElasticsearchIndexer    ejobs.ElasticsearchIndexerInterface
	LdapSync                ejobs.LdapSyncInterface
}

func NewJobServer

func NewJobServer(configService ConfigService, store store.Store) *JobServer

func (*JobServer) CancellationWatcher

func (srv *JobServer) CancellationWatcher(ctx context.Context, jobId string, cancelChan chan interface{})

func (*JobServer) CheckForPendingJobsByType

func (srv *JobServer) CheckForPendingJobsByType(jobType string) (bool, *model.AppError)

func (*JobServer) ClaimJob

func (srv *JobServer) ClaimJob(job *model.Job) (bool, *model.AppError)

func (*JobServer) Config

func (srv *JobServer) Config() *model.Config

func (*JobServer) CreateJob

func (srv *JobServer) CreateJob(jobType string, jobData map[string]string) (*model.Job, *model.AppError)

func (*JobServer) GetJob

func (srv *JobServer) GetJob(id string) (*model.Job, *model.AppError)

func (*JobServer) GetLastSuccessfulJobByType

func (srv *JobServer) GetLastSuccessfulJobByType(jobType string) (*model.Job, *model.AppError)

func (*JobServer) InitSchedulers

func (srv *JobServer) InitSchedulers() *Schedulers

func (*JobServer) InitWorkers

func (srv *JobServer) InitWorkers() *Workers

func (*JobServer) MakeWatcher

func (srv *JobServer) MakeWatcher(workers *Workers, pollingInterval int) *Watcher

func (*JobServer) RequestCancellation

func (srv *JobServer) RequestCancellation(jobId string) *model.AppError

func (*JobServer) SetJobCanceled

func (srv *JobServer) SetJobCanceled(job *model.Job) *model.AppError

func (*JobServer) SetJobError

func (srv *JobServer) SetJobError(job *model.Job, jobError *model.AppError) *model.AppError

func (*JobServer) SetJobProgress

func (srv *JobServer) SetJobProgress(job *model.Job, progress int64) *model.AppError

func (*JobServer) SetJobSuccess

func (srv *JobServer) SetJobSuccess(job *model.Job) *model.AppError

func (*JobServer) StartSchedulers

func (srv *JobServer) StartSchedulers()

func (*JobServer) StartWorkers

func (srv *JobServer) StartWorkers()

func (*JobServer) StopSchedulers

func (srv *JobServer) StopSchedulers()

func (*JobServer) StopWorkers

func (srv *JobServer) StopWorkers()

type Schedulers

type Schedulers struct {
	// contains filtered or unexported fields
}

func (*Schedulers) Start

func (schedulers *Schedulers) Start() *Schedulers

func (*Schedulers) Stop

func (schedulers *Schedulers) Stop() *Schedulers

type StaticConfigService

type StaticConfigService struct {
	Cfg *model.Config
}

func (StaticConfigService) AddConfigListener

func (StaticConfigService) AddConfigListener(func(old, current *model.Config)) string

func (StaticConfigService) Config

func (s StaticConfigService) Config() *model.Config

func (StaticConfigService) RemoveConfigListener

func (StaticConfigService) RemoveConfigListener(string)

type Watcher

type Watcher struct {
	// contains filtered or unexported fields
}

func (*Watcher) PollAndNotify

func (watcher *Watcher) PollAndNotify()

func (*Watcher) Start

func (watcher *Watcher) Start()

func (*Watcher) Stop

func (watcher *Watcher) Stop()

type Workers

type Workers struct {
	ConfigService ConfigService
	Watcher       *Watcher

	DataRetention            model.Worker
	MessageExport            model.Worker
	ElasticsearchIndexing    model.Worker
	ElasticsearchAggregation model.Worker
	LdapSync                 model.Worker
	// contains filtered or unexported fields
}

func (*Workers) Start

func (workers *Workers) Start() *Workers

func (*Workers) Stop

func (workers *Workers) Stop() *Workers

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL