mirror of
https://github.com/stashapp/stash.git
synced 2025-12-07 08:54:10 +01:00
* Refactor session and plugin code * Add context to job tasks * Show hooks in plugins page * Refactor session management
24 lines
642 B
Go
24 lines
642 B
Go
package api
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/stashapp/stash/pkg/logger"
|
|
"github.com/stashapp/stash/pkg/manager"
|
|
"github.com/stashapp/stash/pkg/models"
|
|
)
|
|
|
|
func (r *mutationResolver) RunPluginTask(ctx context.Context, pluginID string, taskName string, args []*models.PluginArgInput) (string, error) {
|
|
m := manager.GetInstance()
|
|
m.RunPluginTask(ctx, pluginID, taskName, args)
|
|
return "todo", nil
|
|
}
|
|
|
|
func (r *mutationResolver) ReloadPlugins(ctx context.Context) (bool, error) {
|
|
err := manager.GetInstance().PluginCache.LoadPlugins()
|
|
if err != nil {
|
|
logger.Errorf("Error reading plugin configs: %s", err.Error())
|
|
}
|
|
|
|
return true, nil
|
|
}
|