contributte / scheduler

:hourglass: PHP job scheduler (cron) with locking for Nette Framework
https://contributte.org/packages/contributte/scheduler.html
MIT License
30 stars 10 forks source link

Enable autoinject is not available in v8.0 #29

Open phebix opened 7 months ago

phebix commented 7 months ago

Hello, in older versions i use autoinject argument in nonfig.neon file e.g.

scheduler:
    jobs:
        MyJob: {class: App\Jobs\MyJOb, inject: true}

In new version this option is no longer available.
In SchedulerExtension.php is only simple factory call without the possibility to set arguments.

$jobDefinition = $builder->addDefinition($this->prefix('job.' . $jobName))
                    ->setFactory($jobConfig)
                    ->setAutowired(false);

would will be possible to enable this option, or switch setAutowired to true