From 6856a816fd994e48a9b7c08703531f99334d19c3 Mon Sep 17 00:00:00 2001 From: Zlatin Balevsky Date: Sat, 3 Oct 2020 14:18:58 +0100 Subject: [PATCH] sleep in a loop at the end of main method. Fixes the processes exiting after 24 days. --- .../src/main/groovy/com/muwire/hostcache/HostCache.groovy | 3 ++- .../src/main/groovy/com/muwire/update/UpdateServer.groovy | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/host-cache/src/main/groovy/com/muwire/hostcache/HostCache.groovy b/host-cache/src/main/groovy/com/muwire/hostcache/HostCache.groovy index 9100ab9c..9c2ce3fe 100644 --- a/host-cache/src/main/groovy/com/muwire/hostcache/HostCache.groovy +++ b/host-cache/src/main/groovy/com/muwire/hostcache/HostCache.groovy @@ -79,7 +79,8 @@ public class HostCache { I2PSession.PROTO_DATAGRAM, I2PSession.PORT_ANY) session.connect() log.info("connected, going to sleep") - Thread.sleep(Integer.MAX_VALUE) + while(true) + Thread.sleep(Integer.MAX_VALUE) } diff --git a/update-server/src/main/groovy/com/muwire/update/UpdateServer.groovy b/update-server/src/main/groovy/com/muwire/update/UpdateServer.groovy index 98a3067d..e402c979 100644 --- a/update-server/src/main/groovy/com/muwire/update/UpdateServer.groovy +++ b/update-server/src/main/groovy/com/muwire/update/UpdateServer.groovy @@ -54,7 +54,8 @@ class UpdateServer { session.addMuxedSessionListener(new Listener(update), I2PSession.PROTO_DATAGRAM, I2PSession.PORT_ANY) session.connect() log.info("Connected, going to sleep") - Thread.sleep(Integer.MAX_VALUE) + while(true) + Thread.sleep(Integer.MAX_VALUE) }