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

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


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

commit 932b81688a3469e9b1c7b59117a91840d35a0571
Author: Aaron Radzinski <[email protected]>
AuthorDate: Thu Dec 3 14:00:49 2020 -0800

    WIP.
---
 .../src/main/scala/org/apache/nlpcraft/probe/NCProbeBoot.scala   | 2 ++
 .../src/main/scala/org/apache/nlpcraft/server/NCServer.scala     | 9 ++++++---
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/NCProbeBoot.scala 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/NCProbeBoot.scala
index 1707f1f..68c1e8d 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/NCProbeBoot.scala
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/NCProbeBoot.scala
@@ -276,6 +276,8 @@ private [probe] object NCProbeBoot extends LazyLogging with 
NCOpenCensusTrace {
                     if (ProcessHandle.of(beacon.pid).isPresent) {
                         logger.warn(s"Another local probe detected (safely 
ignored) [id=${beacon.id}, pid=${beacon.pid}]")
                         logger.warn(s"NOTE: ${c("only one")} locally deployed 
probe can be managed by 'nlpcraft.{sh|cmd}' management script.")
+
+                        // Leave the existing probe beacon as is...
                     } else {
                         logger.trace(s"Overriding probe beacon for a phantom 
process [pid=${beacon.pid}]")
 
diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/server/NCServer.scala 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/server/NCServer.scala
index b6e2f3b..a797813 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/server/NCServer.scala
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/server/NCServer.scala
@@ -338,9 +338,12 @@ object NCServer extends App with NCIgniteInstance with 
LazyLogging with NCOpenCe
                 case Right(rawObj) ⇒
                     val beacon = rawObj.asInstanceOf[NCCliServerBeacon]
 
-                    if (ProcessHandle.of(beacon.pid).isPresent)
-                        logger.error(s"Cannot save server beacon file as 
another live local server detected [pid=${beacon.pid}]")
-                    else {
+                    if (ProcessHandle.of(beacon.pid).isPresent) {
+                        logger.warn(s"Another local server detected (safely 
ignored) [pid=${beacon.pid}]")
+                        logger.warn(s"NOTE: ${c("only one")} locally deployed 
server can be managed by 'nlpcraft.{sh|cmd}' management script.")
+
+                        // Leave the existing server beacon as is...
+                    } else {
                         logger.trace(s"Overriding server beacon for a phantom 
process [pid=${beacon.pid}]")
 
                         save()

Reply via email to