feat: add upload timeout

This commit is contained in:
Rogee
2025-05-06 11:13:49 +08:00
parent 72ab4ad7ec
commit bb689c62e1
4 changed files with 9 additions and 6 deletions

View File

@@ -84,7 +84,7 @@ func (w *DownloadFromAliOSSWorker) Work(ctx context.Context, job *Job[DownloadFr
}
log.Infof("Starting download for file: %s", media.Path)
if err := w.oss.Download(ctx, media.Path, dst, ali.WithInternal(true)); err != nil {
if err := w.oss.Download(ctx, media.Path, dst, ali.WithInternal()); err != nil {
log.Errorf("Error downloading file: %v", err)
return err
}

View File

@@ -101,7 +101,7 @@ func (w *VideoExtractHeadImageWorker) Work(ctx context.Context, job *Job[VideoEx
}
// upload to oss
if err := w.oss.Upload(ctx, output, imageMedia.Path, ali.WithInternal(true)); err != nil {
if err := w.oss.Upload(ctx, output, imageMedia.Path, ali.WithInternal()); err != nil {
log.Errorf("Error uploading image to OSS: %v", err)
return JobCancel(err)
}

View File

@@ -101,7 +101,7 @@ func (w *VideoStoreShortWorker) Work(ctx context.Context, job *Job[VideoStoreSho
}
// upload to oss
if err := w.oss.Upload(ctx, job.Args.FilePath, filePath, ali.WithInternal(true)); err != nil {
if err := w.oss.Upload(ctx, job.Args.FilePath, filePath, ali.WithInternal()); err != nil {
log.Errorf("Error uploading file to OSS: %v", err)
return err
}