queue

package
v1.0.12 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2025 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ForceAddDownloadQueue

func ForceAddDownloadQueue(channelId int64, model repository.Download) error

func GetDownloading

func GetDownloading() ([]repository.DownloadTask, error)

func MigrateDownloadTaskInfo

func MigrateDownloadTaskInfo(tasks []repository.DownloadTask)

func RemoveTasks

func RemoveTasks(ids ...uint)

func ScanAndCreateNewDownloadTasks

func ScanAndCreateNewDownloadTasks(processBefore *int64, channelId ...int64) (int, error)

func TryActivateTaskControl

func TryActivateTaskControl()

func UpdatePriority

func UpdatePriority(id uint, priority int32)

Types

type DownloadTask

type DownloadTask struct {
	ID uint

	ChannelID int64
	MsgID     int64
	// contains filtered or unexported fields
}

func NewTask

func NewTask(channelId int64, model repository.Download) (*DownloadTask, error)

func (*DownloadTask) CompleteDownload

func (task *DownloadTask) CompleteDownload() (ok bool, err error)

func (*DownloadTask) GetVideoFile

func (task *DownloadTask) GetVideoFile() (bool, error)

func (*DownloadTask) Terminate

func (task *DownloadTask) Terminate() error

func (*DownloadTask) UpdateOrDownload

func (task *DownloadTask) UpdateOrDownload(forceStart bool) error

type TaskErrorState

type TaskErrorState struct {
	Err string
	At  time.Time
}

type TaskFileState

type TaskFileState struct {
	File      *client.File
	UpdatedAt time.Time
}

type TaskLogger

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

func NewTaskLogger

func NewTaskLogger(id uint, logger log.FieldLogger) TaskLogger

func (TaskLogger) Errorln

func (tl TaskLogger) Errorln(args ...interface{})

func (TaskLogger) FatalNow

func (tl TaskLogger) FatalNow()

func (TaskLogger) WithField

func (tl TaskLogger) WithField(key string, value interface{}) TaskLogger

Jump to

Keyboard shortcuts

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