This is an automated email from the ASF dual-hosted git repository.
aradzinski pushed a commit to branch NLPCRAFT-194
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git
The following commit(s) were added to refs/heads/NLPCRAFT-194 by this push:
new 50b7b04 WIP.
50b7b04 is described below
commit 50b7b0473c7af98974e5499e3d5359ea14ef76d2
Author: Aaron Radzinski <[email protected]>
AuthorDate: Wed Dec 16 17:16:38 2020 -0800
WIP.
---
.../apache/nlpcraft/common/config/NCConfigurable.scala | 18 ++++++++++--------
.../apache/nlpcraft/model/tools/cmdline/NCCli.scala | 12 +++++-------
2 files changed, 15 insertions(+), 15 deletions(-)
diff --git
a/nlpcraft/src/main/scala/org/apache/nlpcraft/common/config/NCConfigurable.scala
b/nlpcraft/src/main/scala/org/apache/nlpcraft/common/config/NCConfigurable.scala
index 5df0d27..bdbaa53 100644
---
a/nlpcraft/src/main/scala/org/apache/nlpcraft/common/config/NCConfigurable.scala
+++
b/nlpcraft/src/main/scala/org/apache/nlpcraft/common/config/NCConfigurable.scala
@@ -303,19 +303,21 @@ object NCConfigurable extends LazyLogging {
else {
val name = cfgFileOpt.get
- logger.info(s"Attempting to load/merge configuration from
specified configuration file: $name")
+ logger.info(s"Attempting to load/merge configuration from
configuration file: $name")
tmpCfg =
if (dfltCfg.isDefined)
- ConfigFactory.load(ConfigFactory.
- parseFile(new java.io.File(name)).
- withFallback(ConfigFactory.parseResources(name)).
- withFallback(dfltCfg.get)
+ ConfigFactory.load(
+ ConfigFactory.
+ parseFile(new java.io.File(name)).
+ withFallback(ConfigFactory.parseResources(name)).
+ withFallback(dfltCfg.get)
)
else
- ConfigFactory.load(ConfigFactory.
- parseFile(new java.io.File(name)).
- withFallback(ConfigFactory.parseResources(name))
+ ConfigFactory.load(
+ ConfigFactory.
+ parseFile(new java.io.File(name)).
+ withFallback(ConfigFactory.parseResources(name))
)
}
diff --git
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/tools/cmdline/NCCli.scala
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/tools/cmdline/NCCli.scala
index 8fe7556..30fbc41 100644
---
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/tools/cmdline/NCCli.scala
+++
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/tools/cmdline/NCCli.scala
@@ -557,10 +557,10 @@ object NCCli extends App {
validatorArgs ++= jvmOpts
if (cfgPath.isDefined)
- validatorArgs += s"-DNLPCRAFT_PROBE_CONFIG=${cfgPath.get}}"
+ validatorArgs += s"-DNLPCRAFT_PROBE_CONFIG=${cfgPath.get}"
if (mdls != null)
- validatorArgs += s"-DNLPCRAFT_TEST_MODELS=$mdls}"
+ validatorArgs += s"-DNLPCRAFT_TEST_MODELS=$mdls"
validatorArgs += "-cp"
validatorArgs += (if (addCp == null) JAVA_CP else
s"$JAVA_CP$sep$addCp".replace(s"$sep$sep", sep))
@@ -572,12 +572,10 @@ object NCCli extends App {
validatorPb.inheritIO()
try {
- val validatorPid = validatorPb.start().pid()
-
- while (ProcessHandle.of(validatorPid).isPresent)
- Thread.sleep(2.secs) // Check every 2 secs.
+ validatorPb.start().onExit().get()
}
catch {
+ case _: InterruptedException ⇒ () // Ignore.
case e: Exception ⇒ error(s"Failed to run model validator:
${y(e.getLocalizedMessage)}")
}
}
@@ -1010,7 +1008,7 @@ object NCCli extends App {
httpPostResponseJson(
baseUrl,
"signin",
- s"""{"email": "$DFLT_USER_EMAIL", "passwd":
"$DFLT_USER_PASSWD}"}""") match {
+ s"""{"email": "$DFLT_USER_EMAIL", "passwd":
"$DFLT_USER_PASSWD"}""") match {
case Some(json) ⇒
Option(Try(U.getJsonStringField(json,
"acsTok"))) match {
case Some(tok) ⇒