From 790a32d29763fed4e87bce7a8dfaa7b7c10d6013 Mon Sep 17 00:00:00 2001 From: krau <71133316+krau@users.noreply.github.com> Date: Mon, 3 Mar 2025 10:58:03 +0800 Subject: [PATCH] fix(alist): do not upload file as task to prevent alist cache full file --- storage/alist/alist.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/storage/alist/alist.go b/storage/alist/alist.go index d15c7c5..34edc4f 100644 --- a/storage/alist/alist.go +++ b/storage/alist/alist.go @@ -117,7 +117,7 @@ func (a *Alist) Save(ctx context.Context, filePath, storagePath string) error { } req.Header.Set("Authorization", a.token) req.Header.Set("File-Path", url.PathEscape(storagePath)) - req.Header.Set("As-Task", "true") + // req.Header.Set("As-Task", "true") req.Header.Set("Content-Type", "application/octet-stream") req.ContentLength = filestat.Size() @@ -192,7 +192,6 @@ func (a *Alist) NewUploadStream(ctx context.Context, storagePath string) (io.Wri pr, pw := io.Pipe() - // 创建上传流对象 us := &uploadStream{ ctx: ctx, client: a.client, @@ -215,7 +214,7 @@ func (a *Alist) NewUploadStream(ctx context.Context, storagePath string) (io.Wri req.Header.Set("Authorization", a.token) req.Header.Set("File-Path", url.PathEscape(storagePath)) - req.Header.Set("As-Task", "true") + // req.Header.Set("As-Task", "true") req.Header.Set("Content-Type", "application/octet-stream") resp, err := a.client.Do(req)