public static bool ShouldEnable(IServiceProvider serviceProvider) { var scriptHostManager = serviceProvider?.GetService <IScriptHostManager>(); if (scriptHostManager != null && Utility.TryGetHostService(scriptHostManager, out IOptions <HttpOptions> options)) { return(HttpRequestQueue.IsEnabled(options.Value) || options.Value.DynamicThrottlesEnabled); } return(false); }
public static bool ShouldEnable(HttpOptions options) { return(HttpRequestQueue.IsEnabled(options) || options.DynamicThrottlesEnabled); }