schedule

package
v0.7.7 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2023 License: MIT Imports: 8 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ScheduleLockerEnabled = true

Functions

func CreateSchedule

func CreateSchedule(jobname, schedule string, cmd func()) error

Types

type CronZaplog

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

func (*CronZaplog) Error

func (c *CronZaplog) Error(err error, msg string, keysAndValues ...interface{})

func (*CronZaplog) Info

func (c *CronZaplog) Info(msg string, keysAndValues ...interface{})

type JobParams added in v0.7.7

type JobParams struct {
	dig.In
	DB     *gorm.DB `optional:"true"`
	Logger *zap.Logger
	Bus    EventBus.Bus `optional:"true"`
}

type JobSchedule added in v0.7.7

type JobSchedule struct {
	Name         string `gorm:"size:64;primarykey"`
	CreatedAt    time.Time
	UpdatedAt    time.Time
	Schedule     string `gorm:"size:32"`
	LastRuntime  *time.Time
	LastDuration time.Duration
}

It's for job locker

type ScheduleLoker added in v0.7.7

type ScheduleLoker struct {
	Logger  *zap.Logger
	DB      *gorm.DB
	Bus     EventBus.Bus
	Jobname string
}

func (*ScheduleLoker) Create added in v0.7.7

func (sl *ScheduleLoker) Create(name, schedule string) error

func (*ScheduleLoker) Wrapper added in v0.7.7

func (sl *ScheduleLoker) Wrapper() cron.JobWrapper

Jump to

Keyboard shortcuts

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