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

sergeykamov pushed a commit to branch NLPCRAFT-111
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git


The following commit(s) were added to refs/heads/NLPCRAFT-111 by this push:
     new ab0674c  WIP.
ab0674c is described below

commit ab0674ccc76b28eb608679765e3fa434c99631ca
Author: Sergey Kamov <[email protected]>
AuthorDate: Fri Jan 22 11:12:16 2021 +0300

    WIP.
---
 .../common/extcfg/NCExternalConfigManager.scala    | 26 +++++++++++-----------
 .../server/nlp/enrichers/date/NCDateEnricher.scala |  2 +-
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/common/extcfg/NCExternalConfigManager.scala
 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/common/extcfg/NCExternalConfigManager.scala
index dcb8e70..0216941 100644
--- 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/common/extcfg/NCExternalConfigManager.scala
+++ 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/common/extcfg/NCExternalConfigManager.scala
@@ -171,22 +171,22 @@ object NCExternalConfigManager extends NCService with 
NCPoolContext {
 
         val mFiles = FILES.filter(_.modules.contains(module)).map(p ⇒ p.typ → 
p).toMap
 
-        val m = new ConcurrentHashMap[NCExternalConfigType, File]
+        if (mFiles.nonEmpty) {
+            val m = new ConcurrentHashMap[NCExternalConfigType, File]
 
-        U.executeParallel(
-            mFiles.values.flatMap(p ⇒ p.files.map(f ⇒ FileHolder(f, 
p.typ))).toSeq.map(f ⇒ () ⇒ processFile(f, m)): _*
-        )
-
-        val downTypes = m.asScala
-
-        if (downTypes.nonEmpty) {
-            U.executeParallel(
-                downTypes.values.toSeq.map(d ⇒ () ⇒ clearDir(d)): _*
-            )
             U.executeParallel(
-                downTypes.keys.toSeq.
-                    flatMap(t ⇒ mFiles(t).files.toSeq.map(f ⇒ Download(f, 
t))).map(d ⇒ () ⇒ download(d)): _*
+                mFiles.values.flatMap(p ⇒ p.files.map(f ⇒ FileHolder(f, 
p.typ))).toSeq.map(f ⇒ () ⇒ processFile(f, m)): _*
             )
+
+            val downTypes = m.asScala
+
+            if (downTypes.nonEmpty) {
+                U.executeParallel(downTypes.values.toSeq.map(d ⇒ () ⇒ 
clearDir(d)): _*)
+                U.executeParallel(
+                    downTypes.keys.toSeq.
+                        flatMap(t ⇒ mFiles(t).files.toSeq.map(f ⇒ Download(f, 
t))).map(d ⇒ () ⇒ download(d)): _*
+                )
+            }
         }
 
         ackStarted()
diff --git 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/server/nlp/enrichers/date/NCDateEnricher.scala
 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/server/nlp/enrichers/date/NCDateEnricher.scala
index 4800e49..eac0610 100644
--- 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/server/nlp/enrichers/date/NCDateEnricher.scala
+++ 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/server/nlp/enrichers/date/NCDateEnricher.scala
@@ -31,7 +31,7 @@ import java.util.{Calendar ⇒ C}
 import scala.collection.JavaConverters._
 import scala.collection.immutable.Iterable
 import scala.collection.mutable
-import scala.collection.mutable.{LinkedHashMap => LHM}
+import scala.collection.mutable.{LinkedHashMap ⇒ LHM}
 
 /**
   * Date enricher.

Reply via email to