mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 04:14:39 +03:00
Reorder waitgroup completion (#1748)
Rather than passing a pointer to a waitgroup into task.Start(..) functions, handle the waitgroup.Done() at the callsite. This makes waitgroup handling local to its definition rather than it being spread out over multiple files. Tasks now simply execute, and the policy of waiting on them is handled by the caller.
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
package manager
|
||||
|
||||
import (
|
||||
"github.com/remeh/sizedwaitgroup"
|
||||
|
||||
"github.com/stashapp/stash/pkg/ffmpeg"
|
||||
"github.com/stashapp/stash/pkg/logger"
|
||||
"github.com/stashapp/stash/pkg/manager/config"
|
||||
@@ -20,9 +18,7 @@ type GeneratePreviewTask struct {
|
||||
fileNamingAlgorithm models.HashAlgorithm
|
||||
}
|
||||
|
||||
func (t *GeneratePreviewTask) Start(wg *sizedwaitgroup.SizedWaitGroup) {
|
||||
defer wg.Done()
|
||||
|
||||
func (t *GeneratePreviewTask) Start() {
|
||||
videoFilename := t.videoFilename()
|
||||
videoChecksum := t.Scene.GetHash(t.fileNamingAlgorithm)
|
||||
imageFilename := t.imageFilename()
|
||||
|
||||
Reference in New Issue
Block a user