service

package
v0.0.0-...-a4d71d1 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2018 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCronTaskDuplicated = errors.New("cron task is Duplicated")
)

Functions

func AddCronTask

func AddCronTask(ct *CronTask) error

func CheckTask

func CheckTask()

检查任务状态 1. 将TaskStatusRunning标记为TaskStatusUnexceptedExited 2. 将TaskStatusCompleted并且是定时任务的状态重新启动

func GetMTSChan

func GetMTSChan() chan common.MTS

func GetSpiderTaskByModel

func GetSpiderTaskByModel(task *model.Task) (*spider.Task, error)

func ManageTaskStatus

func ManageTaskStatus()

func RestartTask

func RestartTask(task model.Task) error

Types

type CronTask

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

func GetCronTask

func GetCronTask(name string) (*CronTask, bool)

func NewCronTask

func NewCronTask(task *model.Task, retCh chan<- common.MTS) (*CronTask, error)

func (*CronTask) Run

func (ct *CronTask) Run()

func (*CronTask) Start

func (ct *CronTask) Start() error

func (*CronTask) Stop

func (ct *CronTask) Stop() error

Jump to

Keyboard shortcuts

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