MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / processHomePluginTasks

Method processHomePluginTasks

sdk/cliproxy/home_plugins.go:78–100  ·  view source on GitHub ↗
(ctx context.Context, cfg *config.Config)

Source from the content-addressed store, hash-verified

76}
77
78func (s *Service) processHomePluginTasks(ctx context.Context, cfg *config.Config) {
79 if s == nil || cfg == nil || !cfg.Home.Enabled || s.homeClient == nil {
80 return
81 }
82 if ctx == nil {
83 ctx = context.Background()
84 }
85 tasks, errTasks := s.homeClient.GetPluginTasks(ctx)
86 if errTasks != nil {
87 log.Warnf("failed to fetch home plugin tasks: %v", errTasks)
88 return
89 }
90 for _, task := range tasks {
91 if !strings.EqualFold(strings.TrimSpace(task.Operation), "delete") {
92 continue
93 }
94 report := s.processHomePluginDeleteTask(ctx, cfg, task)
95 if !report.OK && strings.TrimSpace(report.Error) != "" {
96 log.Warnf("failed to process home plugin delete task %d for %s: %v", task.ID, task.PluginID, report.Error)
97 }
98 s.reportHomePluginStatus(ctx, cfg, report)
99 }
100}
101
102func (s *Service) processHomePluginDeleteTask(ctx context.Context, cfg *config.Config, task home.PluginTask) homeplugins.SyncReport {
103 return homeplugins.DeleteWithReport(ctx, cfg, s.pluginHost, task.ID, task.PluginID)

Callers 1

Calls 3

GetPluginTasksMethod · 0.80

Tested by

no test coverage detected