Documentation ¶
Index ¶
- Variables
- func NewMonitor(task *model.Download, pool cluster.Pool, mqClient mq.MQ)
- type Monitor
- func (monitor *Monitor) Complete(pool task.Pool) bool
- func (monitor *Monitor) Error(status rpc.StatusInfo) bool
- func (monitor *Monitor) Loop(mqClient mq.MQ)
- func (monitor *Monitor) RemoveTempFolder()
- func (monitor *Monitor) Update() bool
- func (monitor *Monitor) UpdateTaskInfo(status rpc.StatusInfo) error
- func (monitor *Monitor) ValidateFile() error
Constants ¶
This section is empty.
Variables ¶
View Source
var MAX_RETRY = 10
Functions ¶
Types ¶
type Monitor ¶
type Monitor struct { Task *model.Download Interval time.Duration // contains filtered or unexported fields }
Monitor 离线下载状态监控
func (*Monitor) Error ¶
func (monitor *Monitor) Error(status rpc.StatusInfo) bool
Error 任务下载出错处理,返回是否中断监控
func (*Monitor) RemoveTempFolder ¶
func (monitor *Monitor) RemoveTempFolder()
RemoveTempFolder 清理下载临时目录
func (*Monitor) UpdateTaskInfo ¶
func (monitor *Monitor) UpdateTaskInfo(status rpc.StatusInfo) error
UpdateTaskInfo 更新数据库中的任务信息
func (*Monitor) ValidateFile ¶
ValidateFile 上传过程中校验文件大小、文件名
Click to show internal directories.
Click to hide internal directories.