You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwebbeans.apache.org by rm...@apache.org on 2019/10/29 05:01:23 UTC

[openwebbeans-meecrowave] branch master updated: MEECROWAVE-219 patch from Killian Matt to close WatchService in reload on change controller

This is an automated email from the ASF dual-hosted git repository.

rmannibucau pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openwebbeans-meecrowave.git


The following commit(s) were added to refs/heads/master by this push:
     new 02cc9ad  MEECROWAVE-219 patch from Killian Matt to close WatchService in reload on change controller
02cc9ad is described below

commit 02cc9ad48cf644739de053a09ea9823a230be1d3
Author: Romain Manni-Bucau <rm...@apache.org>
AuthorDate: Tue Oct 29 06:01:12 2019 +0100

    MEECROWAVE-219 patch from Killian Matt to close WatchService in reload on change controller
---
 .../org/apache/meecrowave/watching/ReloadOnChangeController.java  | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/meecrowave-core/src/main/java/org/apache/meecrowave/watching/ReloadOnChangeController.java b/meecrowave-core/src/main/java/org/apache/meecrowave/watching/ReloadOnChangeController.java
index e76816a..0a34601 100644
--- a/meecrowave-core/src/main/java/org/apache/meecrowave/watching/ReloadOnChangeController.java
+++ b/meecrowave-core/src/main/java/org/apache/meecrowave/watching/ReloadOnChangeController.java
@@ -103,6 +103,14 @@ public class ReloadOnChangeController implements AutoCloseable, Runnable {
                 Thread.interrupted();
             }
         }
+        if (watchService != null) {
+            try {
+                watchService.close();
+            } catch (final IOException ex) {
+                new LogFacade(ReloadOnChangeController.class.getName())
+                        .warn(ex.getMessage(), ex);
+            }
+        }
     }
 
     public boolean shouldRun() {