Пример #1
0
        public string Invoke(DeployContext model)
        {
            int count = 0;

            while (true)
            {
                count += 1;
                try
                {
                    provider.StartWebSite(model.WebSite);
                    count = 0;
                    return($"Start website {model.WebSite} succeed");
                }
                catch (Exception ex)
                {
                    if (count > 5)
                    {
                        throw ex;
                    }
                    else
                    {
                        System.Threading.Thread.Sleep(2000);
                    }
                }
            }
        }