configFactory->get('automated_cron.settings')->get('interval'); if ($interval > 0) { $cron_next = $this->state->get('system.cron_last', 0) + $interval; if ((int) $event->getRequest()->server->get('REQUEST_TIME') > $cron_next) { ($this->cron)()->run(); } } } /** * Registers the methods in this class that should be listeners. * * @return array * An array of event listener definitions. */ public static function getSubscribedEvents(): array { return [KernelEvents::TERMINATE => [['onTerminate', 100]]]; } }