You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nlpcraft.apache.org by ar...@apache.org on 2021/03/05 01:54:30 UTC

[incubator-nlpcraft] branch NLPCRAFT-262 created (now c999e3c)

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

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


      at c999e3c  Fix for NLPCRAFT-262.

This branch includes the following new commits:

     new c999e3c  Fix for NLPCRAFT-262.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[incubator-nlpcraft] 01/01: Fix for NLPCRAFT-262.

Posted by ar...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit c999e3c4ea76975c1267f00b22059853ccb3990e
Author: Aaron Radzinzski <ar...@datalingvo.com>
AuthorDate: Thu Mar 4 17:54:19 2021 -0800

    Fix for NLPCRAFT-262.
---
 .../org/apache/nlpcraft/model/tools/cmdline/NCCli.scala | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

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 0d411f0..4990849 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
@@ -470,13 +470,16 @@ object NCCli extends App {
     private def cleanUpTempFiles(): Unit = {
         val tstamp = currentTime - 1000 * 60 * 60 * 24 * 2 // 2 days ago.
 
-        for (file <- new File(SystemUtils.getUserHome, ".nlpcraft").listFiles())
-            if (file.lastModified() < tstamp) {
-                val name = file.getName
-
-                if (name.startsWith("server_log") || name.startsWith("server_log") || name.startsWith(".pid_"))
-                    file.delete()
-            }
+        val files = new File(SystemUtils.getUserHome, ".nlpcraft").listFiles()
+        
+        if (files != null)
+            for (file <- files)
+                if (file.lastModified() < tstamp) {
+                    val name = file.getName
+    
+                    if (name.startsWith("server_log") || name.startsWith("server_log") || name.startsWith(".pid_"))
+                        file.delete()
+                }
     }
 
     /**