Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shutdown Unirest workers #5054

Merged
merged 1 commit into from
Jun 14, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/main/java/org/jabref/Globals.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.jabref;

import java.awt.GraphicsEnvironment;
import java.io.IOException;
import java.util.Optional;
import java.util.UUID;

Expand All @@ -24,6 +25,7 @@
import org.jabref.preferences.JabRefPreferences;

import com.google.common.base.StandardSystemProperty;
import com.mashape.unirest.http.Unirest;
import com.microsoft.applicationinsights.TelemetryClient;
import com.microsoft.applicationinsights.TelemetryConfiguration;
import com.microsoft.applicationinsights.internal.shutdown.SDKShutdownActivity;
Expand Down Expand Up @@ -125,6 +127,9 @@ public static void shutdownThreadPools() {

public static void stopBackgroundTasks() {
stopTelemetryClient();
try {
Unirest.shutdown();
} catch (IOException ignore) { }
}

public static Optional<TelemetryClient> getTelemetryClient() {
Expand Down