From 33c5ceb66e2288d7d752407f2c156473b04d94d9 Mon Sep 17 00:00:00 2001 From: Niki Roo Date: Thu, 14 May 2020 17:27:43 +0200 Subject: [PATCH] fix STOP server --- src/be/nikiroo/fanfix/library/WebLibrary.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/be/nikiroo/fanfix/library/WebLibrary.java b/src/be/nikiroo/fanfix/library/WebLibrary.java index 7566877..0f2510d 100644 --- a/src/be/nikiroo/fanfix/library/WebLibrary.java +++ b/src/be/nikiroo/fanfix/library/WebLibrary.java @@ -133,7 +133,17 @@ public class WebLibrary extends BasicLibrary { * in case of I/O errors */ public void stop() throws IOException { - post(WebLibraryUrls.EXIT_URL, null).close(); + try { + post(WebLibraryUrls.EXIT_URL, null).close(); + } catch (Exception e) { + try { + Thread.sleep(200); + } catch (InterruptedException e1) { + } + if (getStatus() != Status.UNAVAILABLE) { + throw new IOException("Cannot exit the library", e); + } + } } @Override -- 2.27.0