aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/soundchan/BotListener/BotListener.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/main/java/soundchan/BotListener/BotListener.java b/src/main/java/soundchan/BotListener/BotListener.java
index 9177385..0dad6c0 100644
--- a/src/main/java/soundchan/BotListener/BotListener.java
+++ b/src/main/java/soundchan/BotListener/BotListener.java
@@ -36,7 +36,6 @@ public class BotListener extends ListenerAdapter{
private final AudioPlayerManager playerManager;
private final Map<Long, GuildMusicManager> musicManagers;
private BotListenerHelpers helper = new BotListenerHelpers();
- private ExecutorService executorService;
private Future<?> future;
// From configuration file
@@ -51,8 +50,6 @@ public class BotListener extends ListenerAdapter{
AudioSourceManagers.registerRemoteSources(playerManager);
AudioSourceManagers.registerLocalSource(playerManager);
- executorService = Executors.newSingleThreadExecutor();
-
loadProperties(properties);
}
@@ -75,10 +72,13 @@ public class BotListener extends ListenerAdapter{
}
else
localManager = new LocalAudioManager(localFilePath);
-
- DirectoryWatcher directoryWatcher = new DirectoryWatcher(localManager, localFilePath);
- future = executorService.submit(directoryWatcher);
- executorService.shutdown();
+
+ if(settingEnableCheck(properties.getProperty("watchLocalFilePath"))) {
+ ExecutorService executorService = Executors.newSingleThreadExecutor();
+ DirectoryWatcher directoryWatcher = new DirectoryWatcher(localManager, localFilePath);
+ future = executorService.submit(directoryWatcher);
+ executorService.shutdown();
+ }
}