Skip to content

Commit 03b789d

Browse files
committed
fix: avviso requisiti cron
1 parent 0b85511 commit 03b789d

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

include/init/requirements.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -416,15 +416,15 @@
416416
$cron_check = [];
417417
if ($database->isInstalled()) {
418418
try {
419-
$ultima_esecuzione = $database->fetchOne('SELECT content FROM zz_cache WHERE name = "Ultima esecuzione del cron"');
419+
$ultima_esecuzione = \Models\Cache::where('name', 'Ultima esecuzione del cron')->first()->content;
420420

421-
if (!$ultima_esecuzione || !$ultima_esecuzione['content']) {
421+
if (!$ultima_esecuzione) {
422422
$cron_status = 0;
423423
$cron_description = tr('Il cron non è stato configurato correttamente. Sembra che il cron di OpenSTAManager non sia in esecuzione.<br><br>È necessario configurare il cron di sistema in modo che esegua periodicamente il file cron.php di OpenSTAManager con il seguente comando:<br><br><code>php _DOCUMENT_ROOT_/cron.php</code><br><br>La frequenza suggerita è di 10 minuti, ma può essere adattata alle tue esigenze. Se invii molte newsletter, per esempio, è consigliato inserire 1 minuto come frequenza.', [
424424
'_DOCUMENT_ROOT_' => $_SERVER['DOCUMENT_ROOT'] ?? base_dir(),
425425
]);
426426
} else {
427-
$data_ultima_esecuzione = new DateTime($ultima_esecuzione['content']);
427+
$data_ultima_esecuzione = new DateTime($ultima_esecuzione);
428428
$ora_attuale = new DateTime();
429429
$ore_trascorse = $ora_attuale->diff($data_ultima_esecuzione)->h + $ora_attuale->diff($data_ultima_esecuzione)->days * 24;
430430

@@ -442,7 +442,7 @@
442442
}
443443
} catch (Exception $e) {
444444
$cron_status = 0;
445-
$cron_description = tr('Errore nel controllo dello stato del cron');
445+
$cron_description = tr('Errore nel controllo dello stato del cron ').$e->getMessage();
446446
}
447447

448448
$cron_check[] = [

0 commit comments

Comments
 (0)