feat(task): add speed monitor (#7655)
This commit is contained in:
@ -4,6 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"time"
|
||||
|
||||
"github.com/alist-org/alist/v3/internal/model"
|
||||
"github.com/alist-org/alist/v3/internal/op"
|
||||
@ -16,7 +17,7 @@ import (
|
||||
)
|
||||
|
||||
type TransferTask struct {
|
||||
task.TaskWithCreator
|
||||
task.TaskExtension
|
||||
FileDir string `json:"file_dir"`
|
||||
DstDirPath string `json:"dst_dir_path"`
|
||||
TempDir string `json:"temp_dir"`
|
||||
@ -25,6 +26,9 @@ type TransferTask struct {
|
||||
}
|
||||
|
||||
func (t *TransferTask) Run() error {
|
||||
t.ClearEndTime()
|
||||
t.SetStartTime(time.Now())
|
||||
defer func() { t.SetEndTime(time.Now()) }()
|
||||
// check dstDir again
|
||||
var err error
|
||||
if (t.file == File{}) {
|
||||
|
Reference in New Issue
Block a user