cron

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2017 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddJob

func AddJob(spec string, job *Job) bool

func Close

func Close()

func CmdParams

func CmdParams(command string) []string

func GetEntries

func GetEntries(size int) []*cron.Entry

func GetEntryById

func GetEntryById(id uint) *cron.Entry

func HistoryJobsRunning

func HistoryJobsRunning() bool

func InitJobs

func InitJobs() error

func Initial

func Initial(sizes ...int)

func InitialMailTpl

func InitialMailTpl()

func MailTpl

func MailTpl() *template.Template

func MainCron

func MainCron(mustStart bool) *cron.Cron

func NewCmdRec

func NewCmdRec(max uint64) *cmdRec

func Parse

func Parse(spec string) error

func RemoveJob

func RemoveJob(id uint)

func Running

func Running() bool

func SendMail

func SendMail(toEmail string, toUsername string, title string, content []byte, ccList ...string) error

Types

type Job

type Job struct {
	Concurrent bool // 同一个任务是否允许并行执行
	// contains filtered or unexported fields
}

func NewCommandJob

func NewCommandJob(id uint, name string, command string) *Job

func NewJobFromTask

func NewJobFromTask(task *dbschema.Task) (*Job, error)

func (*Job) Id

func (j *Job) Id() uint

func (*Job) LogId

func (j *Job) LogId() uint

func (*Job) Name

func (j *Job) Name() string

func (*Job) Run

func (j *Job) Run()

func (*Job) Status

func (j *Job) Status() int

Jump to

Keyboard shortcuts

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