mirror of
https://github.com/slawkens/myaac.git
synced 2025-10-14 09:44:55 +02:00
Avoid duplicate loading of hooks
This commit is contained in:
@@ -7,12 +7,7 @@ use Symfony\Component\Console\Command\Command as SymfonyCommand;
|
||||
|
||||
class Command extends SymfonyCommand
|
||||
{
|
||||
protected Hooks $hooks;
|
||||
|
||||
public function __construct() {
|
||||
parent::__construct();
|
||||
|
||||
$this->hooks = new Hooks();
|
||||
$this->hooks->load();
|
||||
}
|
||||
}
|
||||
|
@@ -19,7 +19,8 @@ class CronjobCommand extends Command
|
||||
// Create a new scheduler
|
||||
$scheduler = new Scheduler();
|
||||
|
||||
$this->hooks->trigger(HOOK_CRONJOB, ['scheduler' => $scheduler]);
|
||||
global $hooks;
|
||||
$hooks->trigger(HOOK_CRONJOB, ['scheduler' => $scheduler]);
|
||||
|
||||
// Let the scheduler execute jobs which are due.
|
||||
$scheduler->run();
|
||||
|
Reference in New Issue
Block a user