feat: update

This commit is contained in:
yanghao05
2025-04-22 14:57:34 +08:00
parent 01a1516e31
commit 163a7c11fe
2 changed files with 4 additions and 7 deletions

View File

@@ -62,6 +62,9 @@ func (w *DownloadFromAliOSSWorker) Work(ctx context.Context, job *Job[DownloadFr
} }
dst := filepath.Join(w.app.StoragePath, media.Path) dst := filepath.Join(w.app.StoragePath, media.Path)
if w.job.Add(&RemoveDownloadedVideo{FilePath: dst}); err != nil {
log.Errorf("Error removing original file: %v", err)
}
// check is path exist // check is path exist
st, err := os.Stat(dst) st, err := os.Stat(dst)
@@ -105,5 +108,6 @@ func (w *DownloadFromAliOSSWorker) NextJob(hash string) error {
log.Errorf("Error adding job: %v", err) log.Errorf("Error adding job: %v", err)
return err return err
} }
return nil return nil
} }

View File

@@ -87,13 +87,6 @@ func (w *VideoCutWorker) Work(ctx context.Context, job *Job[VideoCut]) error {
return JobCancel(err) return JobCancel(err)
} }
// remove original file
if w.job.Add(&RemoveDownloadedVideo{
FilePath: input,
}); err != nil {
log.Errorf("Error removing original file: %v", err)
}
// save to database // save to database
return w.job.Add(&VideoStoreShort{ return w.job.Add(&VideoStoreShort{
MediaHash: media.Hash, MediaHash: media.Hash,