Commit c32929e1 authored by dmorley's avatar dmorley

add other data points to status for fun

parent 74422526
Pipeline #580 passed with stage
in 2 minutes and 32 seconds
......@@ -55,7 +55,7 @@ try {
$sql .= ' WHERE status = ? ORDER BY id';
$pods = R::getAll($sql, [PodStatus::SYSTEM_DELETED]);
} elseif (is_cli()) {
$sql .= ' WHERE status < ? ORDER BY id LIMIT 9';
$sql .= ' WHERE status < ? ORDER BY id';
$pods = R::getAll($sql, [PodStatus::PAUSED]);
}
} catch (\RedBeanPHP\RedException $e) {
......
......@@ -18,6 +18,7 @@ try {
} catch (\RedBeanPHP\RedException $e) {
die('Status Red Error in SQL query: ' . $e->getMessage());
}
try {
$durdbstatus = R::getRow("
SELECT value
......@@ -29,6 +30,31 @@ try {
} catch (\RedBeanPHP\RedException $e) {
die('Status Red Error in SQL query: ' . $e->getMessage());
}
try {
$langdbstatus = R::getRow("
SELECT date_created
FROM meta
WHERE name = 'languages_updated'
ORDER BY id DESC
LIMIT 1
");
} catch (\RedBeanPHP\RedException $e) {
die('Status Red Error in SQL query: ' . $e->getMessage());
}
try {
$backdbstatus = R::getRow("
SELECT date_created
FROM meta
WHERE name = 'backup'
ORDER BY id DESC
LIMIT 1
");
} catch (\RedBeanPHP\RedException $e) {
die('Status Red Error in SQL query: ' . $e->getMessage());
}
$pods_updated_stats = Carbon::createFromFormat('Y-m-d H:i:s.u', $updbstatus['date_created'])->diffInMinutes();
echo "<small>";
if ($pods_updated_stats < 120) {
......@@ -38,5 +64,12 @@ if ($pods_updated_stats < 120) {
}
echo "Last Update was " . $pods_updated_stats . " minutes<br>";
echo "Last Update run duration was " . $durdbstatus['value'] . " minutes";
echo "Last Update run duration was " . $durdbstatus['value'] . " minutes<br>";
$lang_updated_stats = Carbon::createFromFormat('Y-m-d H:i:s.u', $langdbstatus['date_created'])->diffInHours();
echo "Last Language check was " . $lang_updated_stats . " hours<br>";
$back_updated_stats = Carbon::createFromFormat('Y-m-d H:i:s.u', $backdbstatus['date_created'])->diffInMinutes();
echo "Last SQL Backup was " . $back_updated_stats . " minutes<br>";
echo "</small>";
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment