mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 04:44:37 +03:00
Job queueing (#1379)
This commit is contained in:
23
pkg/api/resolver_mutation_job.go
Normal file
23
pkg/api/resolver_mutation_job.go
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user