From 80c5234d5460f972a2852c0f66a6055d575d1836 Mon Sep 17 00:00:00 2001 From: anthonyraymond Date: Thu, 18 May 2017 00:04:07 +0200 Subject: [PATCH] Add comment to prepare next step (Start another torrent when one has stopped). --- src/main/java/org/araymond/joal/tmp/NewClient.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/araymond/joal/tmp/NewClient.java b/src/main/java/org/araymond/joal/tmp/NewClient.java index 3f93b1e..cedd2cb 100644 --- a/src/main/java/org/araymond/joal/tmp/NewClient.java +++ b/src/main/java/org/araymond/joal/tmp/NewClient.java @@ -20,6 +20,8 @@ import org.springframework.context.ApplicationEventPublisher; import java.util.ArrayList; import java.util.List; +import java.util.Timer; +import java.util.TimerTask; /** * Created by raymo on 14/05/2017. @@ -54,7 +56,6 @@ public class NewClient implements AnnouncerEventListener { try { // TODO : find a way or another to add a countdown to stop announce, because we need to reset the uploaded once in a while (prevent long overflow) addSeedingTorrent(); - } catch (final NoMoreTorrentsFileAvailableException e) { if (this.announcers.isEmpty()) { this.publisher.publishEvent(new NoMoreTorrentsFileAvailable()); @@ -105,7 +106,12 @@ public class NewClient implements AnnouncerEventListener { logger.debug("Removed announcer for Torrent {}", torrent.getTorrent().getName()); this.announcers.remove(announcer); this.bandwidthManager.unRegisterTorrent(torrent); - // TODO : restart another one + // TODO : restart another one, but this is tricky, because stop event will be dispatched when we stop joal, so we could run in an infinite loop + /* + if (this.getState() != STOPPED) { + restartAnotherOne + } + */ } }