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

Function ProviderRefreshLead

sdk/cliproxy/auth/types.go:645–664  ·  view source on GitHub ↗
(provider string, runtime any)

Source from the content-addressed store, hash-verified

643}
644
645func ProviderRefreshLead(provider string, runtime any) *time.Duration {
646 provider = strings.ToLower(strings.TrimSpace(provider))
647 if runtime != nil {
648 if eval, ok := runtime.(interface{ RefreshLead() *time.Duration }); ok {
649 if lead := eval.RefreshLead(); lead != nil && *lead > 0 {
650 return lead
651 }
652 }
653 }
654 refreshLeadMu.RLock()
655 factory := refreshLeadFactories[provider]
656 refreshLeadMu.RUnlock()
657 if factory == nil {
658 return nil
659 }
660 if lead := factory(); lead != nil && *lead > 0 {
661 return lead
662 }
663 return nil
664}
665
666func parseTimeValue(v any) (time.Time, bool) {
667 switch value := v.(type) {

Callers 2

nextRefreshCheckAtFunction · 0.85
shouldRefreshMethod · 0.85

Calls 1

RefreshLeadMethod · 0.65

Tested by

no test coverage detected