Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewContext ¶
func NewContext()
NewContext begins cron tasks Each cron task is run within the shutdown context as a running server AtShutdown the cron server is stopped
Types ¶
type BaseConfig ¶ added in v1.12.0
BaseConfig represents the basic config for a Cron task
func (*BaseConfig) DoNoticeOnSuccess ¶ added in v1.13.0
func (b *BaseConfig) DoNoticeOnSuccess() bool
DoNoticeOnSuccess returns whether a success notice should be posted
func (*BaseConfig) DoRunAtStart ¶ added in v1.12.0
func (b *BaseConfig) DoRunAtStart() bool
DoRunAtStart returns whether the task should be run at the start
func (*BaseConfig) FormatMessage ¶ added in v1.12.0
func (b *BaseConfig) FormatMessage(name, status string, doer *models.User, args ...interface{}) string
FormatMessage returns a message for the task
func (*BaseConfig) GetSchedule ¶ added in v1.12.0
func (b *BaseConfig) GetSchedule() string
GetSchedule returns the schedule for the base config
func (*BaseConfig) IsEnabled ¶ added in v1.12.0
func (b *BaseConfig) IsEnabled() bool
IsEnabled returns the enabled status for the config
type CleanupHookTaskConfig ¶ added in v1.14.0
type CleanupHookTaskConfig struct { BaseConfig CleanupType string OlderThan time.Duration NumberToKeep int }
CleanupHookTaskConfig represents a cron task with settings to cleanup hook_task
type Config ¶ added in v1.12.0
type Config interface { IsEnabled() bool DoRunAtStart() bool GetSchedule() string FormatMessage(name, status string, doer *models.User, args ...interface{}) string DoNoticeOnSuccess() bool }
Config represents a basic configuration interface that cron task
type OlderThanConfig ¶ added in v1.12.0
type OlderThanConfig struct { BaseConfig OlderThan time.Duration }
OlderThanConfig represents a cron task with OlderThan setting
type Task ¶ added in v1.12.0
Task represents a Cron task
func (*Task) DoRunAtStart ¶ added in v1.12.0
DoRunAtStart returns if this task should run at the start
type TaskTable ¶ added in v1.12.0
type TaskTable []*TaskTableRow
TaskTable represents a table of tasks
type TaskTableRow ¶ added in v1.12.0
TaskTableRow represents a task row in the tasks table
type UpdateExistingConfig ¶ added in v1.12.0
type UpdateExistingConfig struct { BaseConfig UpdateExisting bool }
UpdateExistingConfig represents a cron task with UpdateExisting setting