tasks

package
v0.0.0-...-8d2a926 Latest Latest
Warning

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

Go to latest
Published: May 13, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeStager = "stager"
)

A list of task types.

Variables

View Source
var (
	StagerQueues = map[string]int{
		"critical": 6,
		"default":  3,
		"low":      1,
	}
)

Queues for different task types, with their associated task priority

Functions

func NewStagerTask

func NewStagerTask(Title, DrUser, DrPass, DstURL, SrcURL, StagerUser, StagerUserEmail string, Timeout, TimeoutNoprogress int64) (*asynq.Task, error)

NewStagerTask wraps payload data into a `asynq.Task` ready for enqueuing.

Types

type Stager

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

Stager implements asynq.Handler interface.

func NewStager

func NewStager(config config.Configuration) *Stager

func (*Stager) ProcessTask

func (stager *Stager) ProcessTask(ctx context.Context, t *asynq.Task) error

type StagerPayload

type StagerPayload struct {

	// creation time of the payload
	CreatedAt int64 `json:"createdAt,omitempty"`

	// short description about the job
	Title string `json:"title"`

	// username of the DR data-access account
	DrUser string `json:"drUser"`

	// password of the DR data-access account
	DrPass string `json:"drPass,omitempty"`

	// path or DR namespace (prefixed with irods:) of the destination endpoint
	DstURL string `json:"dstURL"`

	// path or DR namespace (prefixed with irods:) of the source endpoint
	SrcURL string `json:"srcURL"`

	// username of stager's local account
	StagerUser string `json:"stagerUser"`

	// email of stager's local account
	StagerUserEmail string `json:"stagerUserEmail,omitempty"`

	// allowed duration in seconds for entire transfer job (0 for no timeout)
	Timeout int64 `json:"timeout,omitempty"`

	// allowed duration in seconds for no further transfer progress (0 for no timeout)
	TimeoutNoprogress int64 `json:"timeout_noprogress,omitempty"`
}

StagerPayload defines the data structure of the stager file transfer payload.

type StagerTaskResult

type StagerTaskResult struct {
	Progress struct {
		Total     int64 `json:"total"`
		Processed int64 `json:"processes"`
		Failed    int64 `json:"failed"`
	} `json:"progress"`
}

StagerTaskResult

Jump to

Keyboard shortcuts

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