diff --git a/.gitignore b/.gitignore index b73ee2de..e510cf38 100644 --- a/.gitignore +++ b/.gitignore @@ -33,4 +33,6 @@ *.iml *.ipr *.iws -.idea/ \ No newline at end of file +.idea/ + +.DS_Store \ No newline at end of file diff --git a/common/src/main/java/net/buycraft/plugin/execution/DuePlayerFetcher.java b/common/src/main/java/net/buycraft/plugin/execution/DuePlayerFetcher.java index 56d2e205..9fdcf1c6 100644 --- a/common/src/main/java/net/buycraft/plugin/execution/DuePlayerFetcher.java +++ b/common/src/main/java/net/buycraft/plugin/execution/DuePlayerFetcher.java @@ -6,6 +6,7 @@ import net.buycraft.plugin.data.responses.DueQueueInformation; import java.io.IOException; +import java.net.SocketTimeoutException; import java.util.*; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; @@ -64,6 +65,11 @@ public void run(boolean scheduleAgain) { return; } nextCheck = information.getMeta().getNextCheck(); + } catch (SocketTimeoutException e) { + if (verbose) { + platform.log(Level.SEVERE, "Could not fetch due players queue", e); + } + return; } catch (IOException e) { platform.log(Level.SEVERE, "Could not fetch due players queue", e); return; diff --git a/common/src/main/java/net/buycraft/plugin/execution/ServerEventSenderTask.java b/common/src/main/java/net/buycraft/plugin/execution/ServerEventSenderTask.java index 150b466b..d07a44e2 100644 --- a/common/src/main/java/net/buycraft/plugin/execution/ServerEventSenderTask.java +++ b/common/src/main/java/net/buycraft/plugin/execution/ServerEventSenderTask.java @@ -6,6 +6,7 @@ import net.buycraft.plugin.data.ServerEvent; import java.io.IOException; +import java.net.SocketTimeoutException; import java.util.List; import java.util.logging.Level; @@ -27,7 +28,7 @@ public void run() { return; } - if(platform.getServerInformation() == null || !platform.getServerInformation().getAccount().isLogEvents()) { + if (platform.getServerInformation() == null || !platform.getServerInformation().getAccount().isLogEvents()) { return; } @@ -37,6 +38,11 @@ public void run() { try { if (verbose) platform.log(Level.INFO, "Sending " + runEvents.size() + " analytic events"); platform.getApiClient().sendEvents(runEvents).execute(); + } catch (SocketTimeoutException e) { + if (verbose) { + platform.log(Level.SEVERE, "Failed to send analytic events!", e); + } + return; } catch (IOException | BuyCraftAPIException e) { platform.log(Level.SEVERE, "Failed to send analytic events!", e); return;