cronmodule

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddSimpleJob added in v0.0.2

func AddSimpleJob(spec string, cmd func()) (cron.EntryID, error)

AddSimpleJob 添加简单任务

func AddSimpleSingletonJob added in v0.0.2

func AddSimpleSingletonJob(spec string, cmd func()) (cron.EntryID, error)

AddSimpleSingletonJob 添加简单单例任务 该任务将忽略正在运行的任务的调度

func NewJob added in v0.0.2

func NewJob(jobName string, spec *string, autoReloadSpec bool, cmd func(), multiRun ...bool) *jobFunc

NewJob 初始化一个Job配置

func NewJobAndRegister added in v0.0.4

func NewJobAndRegister(jobName string, spec *string, autoReloadSpec bool, cmd func(), multiRun ...bool) error

NewJobAndRegister 初始化一个Job配置 并注册

func RawInstance

func RawInstance() *cron.Cron

func Start

func Start()

Start 启动已注册任务 如果CronModule.ManualStart = true时一定需要手动开启

Types

type CronModule

type CronModule struct {
	// 启动日志
	EnableLogger bool

	// 手动启动定时任务
	ManualStart bool
}

func (*CronModule) ModuleConfig

func (c *CronModule) ModuleConfig() *declaration.ModuleConfig

func (*CronModule) Register

func (c *CronModule) Register() (interface{}, error)

func (*CronModule) Unregister

func (c *CronModule) Unregister(maxWaitSeconds uint) (bool, error)

Jump to

Keyboard shortcuts

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