aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/soundchan
diff options
context:
space:
mode:
authorMatt Kohls <mattkohls13@gmail.com>2018-10-16 21:57:36 -0400
committerMatt Kohls <mattkohls13@gmail.com>2018-10-16 21:57:36 -0400
commitc674b38d1c2bf15db1ea029aa707609084cb2fb2 (patch)
tree19e37a5b63a9d295bbb2691e50d2412b96ef78cb /src/main/java/soundchan
parent5789f36ca27d9082a1266207453d43f4ed87ef6e (diff)
downloadSoundChan-c674b38d1c2bf15db1ea029aa707609084cb2fb2.tar.gz
SoundChan-c674b38d1c2bf15db1ea029aa707609084cb2fb2.tar.bz2
SoundChan-c674b38d1c2bf15db1ea029aa707609084cb2fb2.zip
Putting watcher threads in map so they can be accessed later
Diffstat (limited to 'src/main/java/soundchan')
-rw-r--r--src/main/java/soundchan/BotListener/BotListener.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/soundchan/BotListener/BotListener.java b/src/main/java/soundchan/BotListener/BotListener.java
index 02c3acd..799b547 100644
--- a/src/main/java/soundchan/BotListener/BotListener.java
+++ b/src/main/java/soundchan/BotListener/BotListener.java
@@ -36,7 +36,7 @@ public class BotListener extends ListenerAdapter{
private final AudioPlayerManager playerManager;
private final Map<Long, GuildMusicManager> musicManagers;
private BotListenerHelpers helper = new BotListenerHelpers();
- private Future<?> future;
+ private Map<String, Future<?> > otherTasks;
// From configuration file
private static String followingUser;
@@ -71,7 +71,7 @@ public class BotListener extends ListenerAdapter{
if(settingEnableCheck(properties.getProperty("watchUserSoundFile"))) {
ExecutorService executorService = Executors.newSingleThreadExecutor();
UserSoundWatcher userSoundWatcher = new UserSoundWatcher(localManager, userAudioPath);
- future = executorService.submit(userSoundWatcher);
+ otherTasks.put("watchUserSoundFile", executorService.submit(userSoundWatcher));
executorService.shutdown();
}
}
@@ -81,7 +81,7 @@ public class BotListener extends ListenerAdapter{
if(settingEnableCheck(properties.getProperty("watchLocalFilePath"))) {
ExecutorService executorService = Executors.newSingleThreadExecutor();
DirectoryWatcher directoryWatcher = new DirectoryWatcher(localManager, localFilePath);
- future = executorService.submit(directoryWatcher);
+ otherTasks.put("watchLocalFilePath", executorService.submit(directoryWatcher));
executorService.shutdown();
}