monitor

package
v1.4.19 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MAX_RETRY = 10

Functions

func NewMonitor

func NewMonitor(task *model.Download, pool cluster.Pool, mqClient mq.MQ)

NewMonitor 新建离线下载状态监控

Types

type Monitor

type Monitor struct {
	Task     *model.Download
	Interval time.Duration
	// contains filtered or unexported fields
}

Monitor 离线下载状态监控

func (*Monitor) Complete

func (monitor *Monitor) Complete(pool task.Pool) bool

Complete 完成下载,返回是否中断监控

func (*Monitor) Error

func (monitor *Monitor) Error(status rpc.StatusInfo) bool

Error 任务下载出错处理,返回是否中断监控

func (*Monitor) Loop

func (monitor *Monitor) Loop(mqClient mq.MQ)

Loop 开启监控循环

func (*Monitor) RemoveTempFolder

func (monitor *Monitor) RemoveTempFolder()

RemoveTempFolder 清理下载临时目录

func (*Monitor) Update

func (monitor *Monitor) Update() bool

Update 更新状态,返回值表示是否退出监控

func (*Monitor) UpdateTaskInfo

func (monitor *Monitor) UpdateTaskInfo(status rpc.StatusInfo) error

UpdateTaskInfo 更新数据库中的任务信息

func (*Monitor) ValidateFile

func (monitor *Monitor) ValidateFile() error

ValidateFile 上传过程中校验文件大小、文件名

Jump to

Keyboard shortcuts

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