feat: modify oss

This commit is contained in:
yanghao05
2025-04-24 10:31:55 +08:00
parent dd2de32317
commit 926b7f8d3b
5 changed files with 3 additions and 7 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); err != nil {
if err := w.oss.Download(ctx, media.Path, dst, ali.WithInternal(true)); err != nil {
log.Errorf("Error downloading file: %v", err)
return err
}

View File

@@ -93,12 +93,10 @@ func Provide(opts ...opt.Option) error {
__job *job.Job,
app *app.Config,
job *job.Job,
oss *ali.OSSClient,
) (contracts.Initial, error) {
obj := &VideoCutWorker{
app: app,
job: job,
oss: oss,
}
if err := river.AddWorkerSafely(__job.Workers, obj); err != nil {
return nil, err

View File

@@ -8,7 +8,6 @@ import (
"quyun/app/models"
"quyun/database/fields"
"quyun/pkg/utils"
"quyun/providers/ali"
"quyun/providers/app"
"quyun/providers/job"
@@ -40,7 +39,6 @@ var _ Worker[VideoCut] = (*VideoCutWorker)(nil)
type VideoCutWorker struct {
WorkerDefaults[VideoCut]
oss *ali.OSSClient
job *job.Job
app *app.Config
}

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); err != nil {
if err := w.oss.Upload(ctx, output, imageMedia.Path, ali.WithInternal(true)); 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); err != nil {
if err := w.oss.Upload(ctx, job.Args.FilePath, filePath, ali.WithInternal(true)); err != nil {
log.Errorf("Error uploading file to OSS: %v", err)
return JobCancel(err)
}