scheduler

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2025 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package scheduler provides task scheduling services

Index

Constants

View Source
const (
	// TaskPrefix is the prefix for all scheduled tasks
	TaskPrefix = "cbt:"
	// QueueName is the queue name for scheduler tasks
	QueueName = "scheduler"
)

Variables

View Source
var (
	// ErrInvalidConcurrency is returned when concurrency is not positive
	ErrInvalidConcurrency = errors.New("concurrency must be positive")
)
View Source
var (
	// ErrScheduleRegistrationFailed is returned when one or more scheduled tasks fail to register
	ErrScheduleRegistrationFailed = errors.New("failed to register scheduled tasks")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Interval    time.Duration `yaml:"interval" default:"1m"`
	Concurrency int           `yaml:"concurrency" default:"10"`
}

Config defines scheduler configuration

func (*Config) Validate

func (c *Config) Validate() error

Validate checks if the scheduler configuration is valid

type Service

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

Service manages scheduled tasks for transformations

func NewService

func NewService(log *logrus.Logger, cfg *Config, redisOpt *redis.Options, dag *models.DependencyGraph, coord *coordinator.Service) (*Service, error)

NewService creates a new scheduler service

func (*Service) HandleScheduledBackfill

func (s *Service) HandleScheduledBackfill(_ context.Context, t *asynq.Task) error

HandleScheduledBackfill processes scheduled backfill scans

func (*Service) HandleScheduledForward

func (s *Service) HandleScheduledForward(_ context.Context, t *asynq.Task) error

HandleScheduledForward processes scheduled forward fill checks

func (*Service) Start

func (s *Service) Start() error

Start initializes and starts the scheduler service

func (*Service) Stop

func (s *Service) Stop() error

Stop gracefully shuts down the scheduler service

Jump to

Keyboard shortcuts

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