diff --git a/includes/Elasticsearch/ESQueue.php b/includes/Elasticsearch/ESQueue.php index db3a0332..81a2eca4 100644 --- a/includes/Elasticsearch/ESQueue.php +++ b/includes/Elasticsearch/ESQueue.php @@ -62,7 +62,7 @@ public static function progress() { MIN(started_at) AS started_at FROM {' . self::QUEUE_TABLE . '} GROUP BY index_name, priority - ORDER BY index_name ASC'; + ORDER BY index_name ASC, priority ASC'; $queues = db_query($query)->fetchAll(); $progress = []; @@ -72,9 +72,9 @@ public static function progress() { $progress_started_at = time(); foreach ($queues as $queue) { - if ($queue->total === $queue->completed) { - continue; - } +// if ($queue->total === $queue->completed) { +// continue; +// } $last_run = new DateTime(); $last_run->setTimestamp($queue->last_run_at); @@ -87,7 +87,7 @@ public static function progress() { $total += $queue->total; $completed += $queue->completed; - $round_name = ' Round: ' . ($queue->priority === 1 ? 'High' : 'Low'); + $round_name = ' Round: ' . (intval($queue->priority) === 1 ? 'High' : 'Low'); $progress[$queue->index_name . $round_name] = (object) [ 'total' => $queue->total, 'completed' => $queue->completed, @@ -96,6 +96,7 @@ public static function progress() { 'last_run_at' => $last_run, 'started_at' => $started_at, 'time' => $queue->last_run_at - $queue->started_at, + 'priority' => $queue->priority ]; } @@ -180,7 +181,6 @@ public static function initProgress( if ($queue) { return db_query('UPDATE {' . $counter_table . '} SET total=:total, last_run_at=:time, completed=:completed, started_at=:started_at WHERE type=:type', [ ':type' => $type, - ':index_name' => $index_name, ':total' => $total, ':completed' => 0, ':time' => time(), diff --git a/includes/indices_management.form.inc b/includes/indices_management.form.inc index 0373fad9..a8d6cbe7 100644 --- a/includes/indices_management.form.inc +++ b/includes/indices_management.form.inc @@ -901,6 +901,10 @@ function tripal_elasticsearch_progress_page($callback = FALSE) { $data = ESQueue::progress(); + if(!$callback) { + dpm($data); + } + $content .= '