cronHandler

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DelayIfStillRunning

func DelayIfStillRunning(ctx context.Context, name string) cron.JobWrapper

DelayIfStillRunning serializes jobs, delaying subsequent runs until the previous one is complete. Jobs running after a delay of more than a minute have the delay logged at Info.

func Recover

func Recover(ctx context.Context, name string) cron.JobWrapper

Recover panics in wrapped jobs and log them with the provided logger.

func SkipIfStillRunning

func SkipIfStillRunning(ctx context.Context, name string) cron.JobWrapper

SkipIfStillRunning skips an invocation of the Job if a previous invocation is still running. It logs skips to the given logger at Info level.

Types

type Handler

type Handler struct {
	Cfg        *config.ServiceConfig
	Interactor *cronRouters.CronInteractor
}

func New

func New(this *Handler) *Handler

func (*Handler) Register

func (h *Handler) Register(ctx context.Context) (*cron.Cron, error)

func (*Handler) Run

func (h *Handler) Run(ctx context.Context) error

Jump to

Keyboard shortcuts

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