Job queueing (#1379)

This commit is contained in:
WithoutPants
2021-05-24 14:24:18 +10:00
committed by GitHub
parent 9aa2dfd96c
commit 0e01374537
42 changed files with 2571 additions and 1110 deletions

View File

@@ -0,0 +1,23 @@
package api
import (
"context"
"strconv"
"github.com/stashapp/stash/pkg/manager"
)
func (r *mutationResolver) StopJob(ctx context.Context, jobID string) (bool, error) {
idInt, err := strconv.Atoi(jobID)
if err != nil {
return false, err
}
manager.GetInstance().JobManager.CancelJob(idInt)
return true, nil
}
func (r *mutationResolver) StopAllJobs(ctx context.Context) (bool, error) {
manager.GetInstance().JobManager.CancelAll()
return true, nil
}