mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 04:04:16 +00:00
graceful shutdown complete if no transit tunnels anymore
This commit is contained in:
parent
8c2de4973c
commit
dfbefee477
@ -13,6 +13,7 @@
|
|||||||
#include "Config.h"
|
#include "Config.h"
|
||||||
#include "FS.h"
|
#include "FS.h"
|
||||||
#include "Log.h"
|
#include "Log.h"
|
||||||
|
#include "Tunnel.h"
|
||||||
#include "RouterContext.h"
|
#include "RouterContext.h"
|
||||||
#include "ClientContext.h"
|
#include "ClientContext.h"
|
||||||
|
|
||||||
@ -163,7 +164,7 @@ namespace i2p
|
|||||||
sigaction(SIGABRT, &sa, 0);
|
sigaction(SIGABRT, &sa, 0);
|
||||||
sigaction(SIGTERM, &sa, 0);
|
sigaction(SIGTERM, &sa, 0);
|
||||||
sigaction(SIGINT, &sa, 0);
|
sigaction(SIGINT, &sa, 0);
|
||||||
sigaction(SIGPIPE, &sa, 0);
|
sigaction(SIGPIPE, &sa, 0);
|
||||||
|
|
||||||
return Daemon_Singleton::start();
|
return Daemon_Singleton::start();
|
||||||
}
|
}
|
||||||
@ -183,7 +184,7 @@ namespace i2p
|
|||||||
if (gracefulShutdownInterval)
|
if (gracefulShutdownInterval)
|
||||||
{
|
{
|
||||||
gracefulShutdownInterval--; // - 1 second
|
gracefulShutdownInterval--; // - 1 second
|
||||||
if (gracefulShutdownInterval <= 0)
|
if (gracefulShutdownInterval <= 0 || i2p::tunnel::tunnels.CountTransitTunnels() <= 0)
|
||||||
{
|
{
|
||||||
LogPrint(eLogInfo, "Graceful shutdown");
|
LogPrint(eLogInfo, "Graceful shutdown");
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user