Пример #1
0
        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);
        }
Пример #2
0
 public static bool ShouldEnable(HttpOptions options)
 {
     return(HttpRequestQueue.IsEnabled(options) || options.DynamicThrottlesEnabled);
 }