From 9cf8777a164c2dae9f847b1f97f4771edca680e5 Mon Sep 17 00:00:00 2001 From: renzhiyuan <465386466@qq.com> Date: Sat, 27 Dec 2025 13:41:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=BC=82=E6=AD=A5=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=EF=BC=8C=E4=BF=AE=E5=A4=8D=E4=B8=8A=E4=BC=A0=E7=A9=BA?= =?UTF-8?q?=E6=8C=87=E9=92=88=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- export_async.go | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/export_async.go b/export_async.go index 7e7c04f..044b48b 100644 --- a/export_async.go +++ b/export_async.go @@ -11,11 +11,6 @@ import ( "strconv" "strings" - "gitea.cdlsxd.cn/self-tools/l-export-async/attachment" - "gitea.cdlsxd.cn/self-tools/l-export-async/coroutine" - "github.com/google/uuid" - "github.com/redis/go-redis/v9" - "golang.org/x/sync/errgroup" "io" "os" "path/filepath" @@ -23,6 +18,12 @@ import ( "sync" "sync/atomic" "time" + + "gitea.cdlsxd.cn/self-tools/l-export-async/attachment" + "gitea.cdlsxd.cn/self-tools/l-export-async/coroutine" + "github.com/google/uuid" + "github.com/redis/go-redis/v9" + "golang.org/x/sync/errgroup" ) var exportAsyncPool = &sync.Pool{ @@ -189,14 +190,16 @@ func (e *ExportAsync) export(ctx context.Context, tempDir string) (source string if err = e.folderToZip(excelsDir, source); err != nil { return } - - if len(e.uploader.Host) > 0 { - e.logTool.Infof("异步导出任务:%s,开始上传", e.task.Id) - source, err = e.upload(source) - if err != nil { - return + if e.uploader != nil { + if len(e.uploader.Host) > 0 { + e.logTool.Infof("异步导出任务:%s,开始上传", e.task.Id) + source, err = e.upload(source) + if err != nil { + return + } } } + e.task.Source = source e.processAdd(ctx, ATT.int()) return