Commit b3f5ce85 authored by dmorley's avatar dmorley

use function for update

parent 7282fd54
Pipeline #585 passed with stage
in 3 minutes and 47 seconds
......@@ -249,19 +249,7 @@ foreach ($pods as $pod) {
$status = PodStatus::UP;
}
try {
$updbstatus = 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());
}
$langdays = Carbon::createFromFormat('Y-m-d H:i:s.u', $updbstatus['date_created'])->diffInDays();
$langhours = Carbon::createFromFormat('Y-m-d H:i:s.u', getMeta('languages_updated', 'date_created'))->diffInHours();
// Default to the already saved language.
$detectedlanguage = $language;
......@@ -271,7 +259,7 @@ foreach ($pods as $pod) {
$detectedlanguage = null;
--$score;
$podminhelp = 'Unable to render the html on your main page https://' . $domain;
} elseif ($debug || $langdays > 1) {
} elseif ($debug || $langhours > 24) {
$detectedlanguage = detectWebsiteLanguageFromSnippet($language_snippet);
$languagesupdated = true;
}
......
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