| 220 | } |
| 221 | |
| 222 | void DaemonUnix::run () |
| 223 | { |
| 224 | i2p::util::SetThreadName ("i2pd-daemon"); |
| 225 | while (running) |
| 226 | { |
| 227 | std::this_thread::sleep_for (std::chrono::seconds(1)); |
| 228 | if (gracefulShutdownInterval) |
| 229 | { |
| 230 | gracefulShutdownInterval--; // - 1 second |
| 231 | if (gracefulShutdownInterval <= 0 || i2p::tunnel::tunnels.CountTransitTunnels() <= 0) |
| 232 | { |
| 233 | LogPrint(eLogInfo, "Graceful shutdown"); |
| 234 | return; |
| 235 | } |
| 236 | } |
| 237 | } |
| 238 | } |
| 239 | } |
| 240 | } |
| 241 | #endif |
no test coverage detected