Skip to content

Commit 3399cd9

Browse files
committed
.
1 parent 3ecfe6c commit 3399cd9

6 files changed

Lines changed: 3 additions & 24 deletions

File tree

internal/fs/archive.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,6 @@ func (t *ArchiveContentUploadTask) GetStatus() string {
159159
return t.status
160160
}
161161

162-
var _ task.Lifecycle = (*ArchiveContentUploadTask)(nil)
163-
164162
func (t *ArchiveContentUploadTask) BeforeRun() error {
165163
return nil
166164
}

internal/fs/copy.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ func (t *CopyTask) GetStatus() string {
4040
return t.Status
4141
}
4242

43-
var _ task.Lifecycle = (*CopyTask)(nil)
44-
4543
func (t *CopyTask) BeforeRun() error {
4644
return nil
4745
}

internal/fs/move.go

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,7 @@ import (
2121
"github.com/pkg/errors"
2222
)
2323

24-
type MoveTask struct {
25-
task.TaskExtension
26-
Status string `json:"-"` //don't save status to save space
27-
SrcObjPath string `json:"src_path"`
28-
DstDirPath string `json:"dst_path"`
29-
srcStorage driver.Driver `json:"-"`
30-
dstStorage driver.Driver `json:"-"`
31-
SrcStorageMp string `json:"src_storage_mp"`
32-
DstStorageMp string `json:"dst_storage_mp"`
33-
targetPath string
34-
}
24+
type MoveTask CopyTask
3525

3626
func (t *MoveTask) GetName() string {
3727
return fmt.Sprintf("move [%s](%s) to [%s](%s)", t.SrcStorageMp, t.SrcObjPath, t.DstStorageMp, t.DstDirPath)
@@ -45,8 +35,6 @@ func (t *MoveTask) Run() error {
4535
return task.RunWithLifecycle(t)
4636
}
4737

48-
var _ task.Lifecycle = (*MoveTask)(nil)
49-
5038
func (t *MoveTask) BeforeRun() error {
5139
return nil
5240
}

internal/fs/put.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ func (t *UploadTask) GetStatus() string {
3434
return "uploading"
3535
}
3636

37-
var _ task.Lifecycle = (*UploadTask)(nil)
38-
3937
func (t *UploadTask) BeforeRun() error {
4038
return nil
4139
}

internal/offline_download/tool/transfer.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ type TransferTask struct {
3737
targetPath string
3838
}
3939

40-
var _ task.Lifecycle = (*TransferTask)(nil)
41-
4240
func (t *TransferTask) BeforeRun() error {
4341
return nil
4442
}

internal/task/batch_task/refresh.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package batch_task
33
import (
44
"context"
55
"path"
6-
stdpath "path"
76

87
"github.com/OpenListTeam/OpenList/v4/internal/driver"
98
"github.com/OpenListTeam/OpenList/v4/internal/model"
@@ -60,7 +59,7 @@ func verify(ctx context.Context, srcStorage, dstStorage driver.Driver, srcPath,
6059
return errors.WithMessagef(err, "failed get src [%s] file", path.Join(srcStorage.GetStorage().MountPath, srcPath))
6160
}
6261

63-
dstObjPath := stdpath.Join(dstPath, srcObj.GetName())
62+
dstObjPath := path.Join(dstPath, srcObj.GetName())
6463
dstObj, err := op.Get(ctx, dstStorage, dstObjPath)
6564
if err != nil {
6665
return errors.WithMessagef(err, "failed get dst [%s] file", path.Join(dstStorage.GetStorage().MountPath, dstObjPath))
@@ -77,7 +76,7 @@ func verify(ctx context.Context, srcStorage, dstStorage driver.Driver, srcPath,
7776
}
7877

7978
for _, obj := range srcObjs {
80-
srcSubPath := stdpath.Join(srcPath, obj.GetName())
79+
srcSubPath := path.Join(srcPath, obj.GetName())
8180
err := verify(ctx, srcStorage, dstStorage, srcSubPath, dstObjPath)
8281
if err != nil {
8382
return err

0 commit comments

Comments
 (0)