コード例 #1
0
        private bool IsDiskFailure(bool dochecknow, uint iteration, string host, Dictionary <string, int> roguehosts, out string reason)
        {
            reason = null;
            foreach (KeyValuePair <string, Surrogate.HealthPlugin> pair in healthplugins)
            {
                Surrogate.HealthPlugin plugin = pair.Value;
                bool docheck = false;

                if (dochecknow)
                {
                    docheck = true;
                }
                else
                {
                    if (iteration > plugin.StartInteration)
                    {
                        docheck = (iteration - plugin.StartInteration) % plugin.ExecutionSkipFactor == 0;
                    }
                    else if (iteration == plugin.StartInteration)
                    {
                        docheck = true;
                    }
                }

                if (docheck)
                {
                    Surrogate.HealthMethod hm = plugin.Method;
                    if (Surrogate.SafeCallHealthMethod(hm, host, roguehosts, out reason))
                    {
                        reason = null;
                    }
                    else
                    {
                        return(true);
                    }
                }
            }
            return(false);
        }