Stop MailPoet Daemon execution when in maintenance mode

MAILPOET-6021
This commit is contained in:
Oluwaseun Olorunsola
2024-05-09 15:05:27 +01:00
committed by Oluwaseun Olorunsola
parent d718441e1a
commit 19ad4133ab

View File

@ -45,6 +45,11 @@ class Daemon {
$errors = [];
foreach ($this->getWorkers() as $worker) {
if (wp_is_maintenance_mode()) {
// stop execution when in maintenance mode
break;
}
try {
// Clear the entity manager memory for every cron run.
// This avoids using stale data and prevents memory leaks.