mirror of
https://github.com/stashapp/stash.git
synced 2025-12-06 16:34:02 +01:00
* Move conversions into changesetTranslator * Improve mutation error messages * Use models.New and models.NewPartial everywhere * Replace getStashIDsFor functions * Remove ImageCreateInput * Remove unused parameters * Refactor matching functions --------- Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
24 lines
504 B
Go
24 lines
504 B
Go
package api
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
"strconv"
|
|
|
|
"github.com/stashapp/stash/internal/manager"
|
|
)
|
|
|
|
func (r *mutationResolver) StopJob(ctx context.Context, jobID string) (bool, error) {
|
|
id, err := strconv.Atoi(jobID)
|
|
if err != nil {
|
|
return false, fmt.Errorf("converting id: %w", err)
|
|
}
|
|
manager.GetInstance().JobManager.CancelJob(id)
|
|
|
|
return true, nil
|
|
}
|
|
|
|
func (r *mutationResolver) StopAllJobs(ctx context.Context) (bool, error) {
|
|
manager.GetInstance().JobManager.CancelAll()
|
|
return true, nil
|
|
}
|