cronjobs

package
v0.393.1 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

func New

func New(ctx context.Context, key model.ControllerKey, requestSource string, encryption *encryptionsvc.Service, timeline *timeline.Service, conn *sql.DB) *Service

func NewForTesting

func NewForTesting(ctx context.Context, key model.ControllerKey, requestSource string, encryption *encryptionsvc.Service, timeline *timeline.Service, dal dal.DAL, clock clock.Clock) *Service

func (*Service) CreatedOrReplacedDeloyment

func (s *Service) CreatedOrReplacedDeloyment(ctx context.Context) error

CreatedOrReplacedDeloyment is called by the responsible controller to its cron service, we can schedule all cron jobs here since the cron_jobs rows are locked within the transaction and the controllers won't step on each other.

func (*Service) DeleteCronJobsForDeployment added in v0.383.1

func (s *Service) DeleteCronJobsForDeployment(ctx context.Context, key model.DeploymentKey) error

func (*Service) NewCronJobsForModule

func (s *Service) NewCronJobsForModule(ctx context.Context, module *schema.Module) ([]model.CronJob, error)

func (*Service) OnJobCompletion added in v0.359.0

func (s *Service) OnJobCompletion(ctx context.Context, key model.CronJobKey, failed bool) (err error)

OnJobCompletion is called by the controller when a cron job async call completes. We schedule the next execution of the cron job here.

func (*Service) ScheduleCronJobs added in v0.383.1

func (s *Service) ScheduleCronJobs(ctx context.Context) (err error)

scheduleCronJobs schedules all cron jobs that are not already scheduled.

Directories

Path Synopsis
internal
dal
sql

Jump to

Keyboard shortcuts

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