From 58d153e5ff35bbb416e69593be064f992894ec1c Mon Sep 17 00:00:00 2001 From: Noah Hsu Date: Wed, 29 Jun 2022 18:56:31 +0800 Subject: [PATCH] fix: task list method --- internal/bootstrap/aria2.go | 8 ++++++-- server/router.go | 12 ++++++------ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/internal/bootstrap/aria2.go b/internal/bootstrap/aria2.go index bf63e7536ca..936358c46ca 100644 --- a/internal/bootstrap/aria2.go +++ b/internal/bootstrap/aria2.go @@ -1,9 +1,13 @@ package bootstrap -import "github.com/alist-org/alist/v3/internal/aria2" +import ( + "github.com/alist-org/alist/v3/internal/aria2" + log "github.com/sirupsen/logrus" +) func InitAria2() { go func() { - _ = aria2.InitClient(2) + err := aria2.InitClient(2) + log.Errorf("failed to init aria2 client: %+v", err) }() } diff --git a/server/router.go b/server/router.go index dd2a61e0b05..105ceeabc44 100644 --- a/server/router.go +++ b/server/router.go @@ -57,14 +57,14 @@ func Init(r *gin.Engine) { task.GET("/down/undone", controllers.UndoneDownTask) task.GET("/down/done", controllers.DoneDownTask) task.POST("/down/cancel", controllers.CancelDownTask) - task.POST("/transfer/undone", controllers.UndoneTransferTask) - task.POST("/transfer/done", controllers.DoneTransferTask) + task.GET("/transfer/undone", controllers.UndoneTransferTask) + task.GET("/transfer/done", controllers.DoneTransferTask) task.POST("/transfer/cancel", controllers.CancelTransferTask) - task.POST("/upload/undone", controllers.UndoneUploadTask) - task.POST("/upload/done", controllers.DoneUploadTask) + task.GET("/upload/undone", controllers.UndoneUploadTask) + task.GET("/upload/done", controllers.DoneUploadTask) task.POST("/upload/cancel", controllers.CancelUploadTask) - task.POST("/copy/undone", controllers.UndoneCopyTask) - task.POST("/copy/done", controllers.DoneCopyTask) + task.GET("/copy/undone", controllers.UndoneCopyTask) + task.GET("/copy/done", controllers.DoneCopyTask) task.POST("/copy/cancel", controllers.CancelCopyTask) // guest can