tasklist

package
v1.2.13-prerelease10 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2024 License: MIT Imports: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options added in v0.22.0

type Options struct {
	GetOrphanTasksPageSizeFn dynamicconfig.IntPropertyFn
	TaskBatchSizeFn          dynamicconfig.IntPropertyFn
	EnableCleaning           dynamicconfig.BoolPropertyFn
	MaxTasksPerJobFn         dynamicconfig.IntPropertyFn
	ExecutorPollInterval     time.Duration
}

Options is used to customize scavenger operations

type Scavenger

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

Scavenger is the type that holds the state for task list scavenger daemon

func NewScavenger

func NewScavenger(
	ctx context.Context,
	db p.TaskManager,
	metricsClient metrics.Client,
	logger log.Logger,
	opts *Options,
	cache cache.DomainCache,
) *Scavenger

NewScavenger returns an instance of executorTask list scavenger daemon The Scavenger can be started by calling the Start() method on the returned object. Calling the Start() method will result in one complete iteration over all of the task lists in the system. For each task list, the scavenger will attempt

  • deletion of expired tasks in the task lists
  • deletion of task list itself, if there are no tasks and the task list hasn't been updated for a grace period

The scavenger will retry on all persistence errors infinitely and will only stop under two conditions

  • either all task lists are processed successfully (or)
  • Stop() method is called to stop the scavenger

func (*Scavenger) Alive

func (s *Scavenger) Alive() bool

Alive returns true if the scavenger is still running

func (*Scavenger) Start

func (s *Scavenger) Start()

Start starts the scavenger

func (*Scavenger) Stop

func (s *Scavenger) Stop()

Stop stops the scavenger

Jump to

Keyboard shortcuts

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