mirror of
https://bitbucket.org/anguist/ntpa
synced 2025-10-05 10:30:56 +00:00
Ensure pid file are deleted
This commit is contained in:
@ -51,34 +51,39 @@ namespace Ntp.Analyzer.Process
|
|||||||
|
|
||||||
public void Run()
|
public void Run()
|
||||||
{
|
{
|
||||||
bool reload = true;
|
try
|
||||||
while (reload)
|
|
||||||
{
|
{
|
||||||
var i = new Initializer(configFile, pid, pidFile, name, initlog);
|
bool reload = true;
|
||||||
i.Run();
|
while (reload)
|
||||||
|
|
||||||
if (!i.Ready)
|
|
||||||
break;
|
|
||||||
|
|
||||||
var c = new Cluster(i.Scheduler, i.Controller, i.Nodes, i.Log);
|
|
||||||
c.Activate();
|
|
||||||
|
|
||||||
reload = i.Controller.Reload;
|
|
||||||
|
|
||||||
foreach (Listener l in i.Listeners)
|
|
||||||
l.Close();
|
|
||||||
|
|
||||||
LogFactory.Cleanup();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pidFile != null)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
File.Delete(pidFile);
|
var i = new Initializer(configFile, pid, pidFile, name, initlog);
|
||||||
|
i.Run();
|
||||||
|
|
||||||
|
if (!i.Ready)
|
||||||
|
break;
|
||||||
|
|
||||||
|
var c = new Cluster(i.Scheduler, i.Controller, i.Nodes, i.Log);
|
||||||
|
c.Activate();
|
||||||
|
|
||||||
|
reload = i.Controller.Reload;
|
||||||
|
|
||||||
|
foreach (Listener l in i.Listeners)
|
||||||
|
l.Close();
|
||||||
|
|
||||||
|
LogFactory.Cleanup();
|
||||||
}
|
}
|
||||||
catch (Exception)
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
if (pidFile != null)
|
||||||
{
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
File.Delete(pidFile);
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,6 @@ namespace Ntp.Data.Provider
|
|||||||
#if MYSQL
|
#if MYSQL
|
||||||
return new MySqlFactory();
|
return new MySqlFactory();
|
||||||
#else
|
#else
|
||||||
// TODO: Ensure pid file are deleted
|
|
||||||
throw new ApplicationException("NTP Analyzer was not build wit MySQL support.");
|
throw new ApplicationException("NTP Analyzer was not build wit MySQL support.");
|
||||||
#endif
|
#endif
|
||||||
case SqlDatabaseProvider.PostgreSql:
|
case SqlDatabaseProvider.PostgreSql:
|
||||||
|
Reference in New Issue
Block a user