using JinherAMPBTPDeploy;
using MicrosoftWebAdministration;
using RedisHelper;
using System;
using SystemCollectionsGeneric;
using SystemConfiguration;
using SystemIO;
using SystemLinq;
using SystemText;
using SystemThreading;
using SystemThreadingTasks;
namespace Redis
{
public class Program
{
static readonly string AppPoolName = ConfigurationManagerAppSettings["ApplicationPoolName"]ToString();
static readonly string WebSiteName = ConfigurationManagerAppSettings["WebSiteName"]ToString();
static readonly int SleepTime = intParse(ConfigurationManagerAppSettings["SleepTime"]ToString());
static ServerManager sm;
static void Main(string[] args)
{
ConsoleWriteLine($"检测程序启动,{WebSiteName}当网站或其应用池停下后,会自动启动。");
sm = new ServerManager();
new Thread(RecoveryWebSite)Start();
}
static void RecoveryWebSite()
{
while (true)
{
try
{
var pool = smApplicationPools[AppPoolName];
if (pool != null && poolState == ObjectStateStopped)
{
ConsoleWriteLine("检测到应用池" + AppPoolName + "停止服务");
ConsoleWriteLine("正在启动应用池" + AppPoolName);
if (poolStart() == ObjectStateStarted)
{
ConsoleWriteLine("成功启动应用池" + AppPoolName);
}
else
{
ConsoleWriteLine("启动应用池" + AppPoolName + "失败 " + SleepTime / 60 + "秒后重试启动");
}
}
var site = smSites[WebSiteName];
if (site != null && siteState == ObjectStateStopped)
{
ConsoleWriteLine("检测到网站" + WebSiteName + "停止服务");
ConsoleWriteLine("正在启动网站" + WebSiteName);
if (siteStart() == ObjectStateStarted)
{
ConsoleWriteLine("成功启动网站" + WebSiteName);
}
else
{
ConsoleWriteLine("启动网站" + WebSiteName + "失败 " + SleepTime / 60 + "秒后重试启动");
}
}
}
catch (Exception ex)
{
ConsoleWriteLine(exMessageToString());
}
GCCollect();
ThreadSleep(SleepTime);
}
}
}
}翻译:
服务器已经打开
无法自动确定时区。一个不正确的时区会导致不正确的时间戳日志控制台。它被设置为“UTC”默认情况下。你可以改变它在phpini文件。
线程必须大于或等于209,而你的是208
请使用主页上提供的安装程序,或重新编译PHP
服务器已关闭
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)