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

Method syncHomePlugins

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

Source from the content-addressed store, hash-verified

20const homePluginStatusReportTimeout = 10 * time.Second
21
22func (s *Service) syncHomePlugins(ctx context.Context, cfg *config.Config) (homeplugins.SyncReport, string, bool, error) {
23 if s == nil || cfg == nil || !cfg.Home.Enabled {
24 return homeplugins.SyncReport{}, "", false, nil
25 }
26 syncKey := homePluginSyncKey(cfg)
27 if syncKey != "" {
28 s.homePluginSyncMu.Lock()
29 if s.homePluginSyncKey == syncKey {
30 s.homePluginSyncMu.Unlock()
31 return homeplugins.SyncReport{}, syncKey, false, nil
32 }
33 s.homePluginSyncMu.Unlock()
34 }
35 report, errSync := homeplugins.SyncWithReport(ctx, cfg, s.pluginHost)
36 return report, syncKey, true, errSync
37}
38
39func (s *Service) markHomePluginsSynced(syncKey string) {
40 if s == nil || strings.TrimSpace(syncKey) == "" {

Calls 2

SyncWithReportFunction · 0.92
homePluginSyncKeyFunction · 0.85