viewgit/inc/functions.php:22 Function utf8_encode() is deprecated [8192]

Add more logging messages Queue Server, a=chris

Chris Pollett [2019-06-24 23:Jun:th]
Add more logging messages Queue Server, a=chris
Filename
src/executables/QueueServer.php
src/library/CrawlDaemon.php
diff --git a/src/executables/QueueServer.php b/src/executables/QueueServer.php
index cbe5177c9..e249ade3b 100755
--- a/src/executables/QueueServer.php
+++ b/src/executables/QueueServer.php
@@ -577,17 +577,20 @@ class QueueServer implements CrawlConstants, Join
                 L\logLineTimestamp($lines[0]);
         }
         $error_log = C\CRASH_LOG_NAME;
-        if (!file_exists($error_log) || filesize($error_log)>
+        L\crawlLog( "!!!!Writing to $error_log " .
+            "crash message about $process...");
+        if (!file_exists($error_log) || filesize($error_log) >
             C\MAX_LOG_FILE_SIZE) {
             file_put_contents($error_log, $out_msg);
         } else {
             file_put_contents($error_log, $out_msg, FILE_APPEND);
         }
-        $init_args = [substr($this->process_name, 2) . ".php", "start",
-            "none", $process];
-        CrawlDaemon::init( $init_args, $this->process_name, -3);
+        $init_args = ["QueueServer.php", "start", $this->channel, $process];
+        L\crawlLog( "!!!!Writing to $error_log ".
+            "crash message about $process...");
+        CrawlDaemon::init( $init_args, "QueueServer", -3);
         if ($info[self::STATUS] != self::WAITING_START_MESSAGE_STATE) {
-            L\crawlLog("Sleeping before trying to restart other process crawl");
+            L\crawlLog("Sleeping before sending restart message other process");
             sleep(2 * C\QUEUE_SLEEP_TIME);
             $crawl_params = [];
             $crawl_params[self::STATUS] = "RESUME_CRAWL";
@@ -598,7 +601,7 @@ class QueueServer implements CrawlConstants, Join
             $process_message_file = C\CRAWL_DIR . "/schedules/" .
                 $this->process_name . "Messages.txt";
             file_put_contents($process_message_file, $info_string);
-            chmod(C\CRAWL_DIR."/schedules/" . $this->process_name .
+            chmod(C\CRAWL_DIR . "/schedules/" . $this->process_name .
                 "Messages.txt", 0777);
         }
     }
@@ -1004,7 +1007,8 @@ class QueueServer implements CrawlConstants, Join
                     } else if (!$is_scheduler) {
                         $msg = "Restart failed!!!  ";
                         if (!isset($info[self::CRAWL_TIME])) {
-                            $msg .="crawl time of crawl to restart not given\n";
+                            $msg .=
+                                "crawl time of crawl to restart not given\n";
                         }
                         if (!file_exists(C\CRAWL_DIR.'/cache/'.
                             self::queue_base_name . $info[self::CRAWL_TIME])) {
@@ -1227,7 +1231,7 @@ class QueueServer implements CrawlConstants, Join
                 if ($plugin == "") {continue; }
                 $plugin_instance_name =
                     lcfirst($plugin)."Plugin";
-                $plugin_name = C\NS_PLUGINS . $plugin."Plugin";
+                $plugin_name = C\NS_PLUGINS . $plugin . "Plugin";
                 $this->$plugin_instance_name =
                     new $plugin_name();
                 if (method_exists($plugin_name, "setConfiguration") &&
@@ -1917,6 +1921,7 @@ class QueueServer implements CrawlConstants, Join
                 "index bundle.");
             $this->index_archive->forceSave();
             $this->index_archive = null;
+            $this->hourly_crawl_data = [];
             $num_freed = L\garbageCollect();
             L\crawlLog("...Indexer force running garbage collector " .
                 "after reset. This freed " . $num_freed . " bytes.");
diff --git a/src/library/CrawlDaemon.php b/src/library/CrawlDaemon.php
index 4ac836328..654b8552a 100644
--- a/src/library/CrawlDaemon.php
+++ b/src/library/CrawlDaemon.php
@@ -153,7 +153,9 @@ class CrawlDaemon implements CrawlConstants
             "php $name.php start //starts the $name as a daemon\n" .
             "php $name.php stop //stops the $name daemon\n" .
             "php $name.php terminal //runs $name within the current\n" .
-            "\tprocess, not as a daemon, output going to the terminal\n";
+            "\tprocess, not as a daemon, output going to the terminal\n" .
+            "Additional arguments are described in Yioop documentation.\n";
+
         self::$name = $name;
         if (isset($argv[2]) && $argv[2] != "none") {
             self::$subname = $argv[2];
ViewGit