cron

package
v0.0.0-...-3a98d3a Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2025 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Overview

Package cron defines the service's cron job.

Index

Constants

View Source
const TTL = time.Hour

TTL is the time before a config expires.

Variables

This section is empty.

Functions

func Cleanup

Cleanup flow rolls back excluded DUTs from Cloudbots to Drone. Excluded DUTs are determined by the config migration file.

func Migrate

Migrate flow migrates and rolls back DUTs based on a config migration file.

func Regulate

func Regulate(ctx context.Context, opts *regulator.RegulatorOptions) error

Regulate is BotsRegulator main flow. It fetches available DUTs from UFS based on specific filters and sends out the result to a predefined Bots Provider Interface.

Types

type LastSeenConfig

type LastSeenConfig struct {
	Digest []byte
	Exp    time.Time
}

LastSeenConfig is a simple cache to avoid unnecessary cron runs.

func (*LastSeenConfig) IsExpired

func (l *LastSeenConfig) IsExpired() bool

func (*LastSeenConfig) MarkAsSeen

func (l *LastSeenConfig) MarkAsSeen(digest []byte)

func (*LastSeenConfig) WasSeen

func (l *LastSeenConfig) WasSeen(digest []byte) bool

Jump to

Keyboard shortcuts

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