File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -652,11 +652,15 @@ being transferred and processed by its handler::
652652 #[AsSchedule('uptoyou')]
653653 class SaleTaskProvider implements ScheduleProviderInterface
654654 {
655+ public function __construct(private EventDispatcherInterface $dispatcher)
656+ {
657+ }
658+
655659 public function getSchedule(): Schedule
656660 {
657661 $this->removeOldReports = RecurringMessage::cron('3 8 * * 1', new CleanUpOldSalesReport());
658662
659- return $this->schedule ??= (new Schedule())
663+ return $this->schedule ??= (new Schedule($this->dispatcher ))
660664 ->with(
661665 // ...
662666 )
@@ -671,7 +675,7 @@ being transferred and processed by its handler::
671675 $schedule->removeById($messageContext->id);
672676
673677 // allow to call the ShouldCancel() and avoid the message to be handled
674- $event->shouldCancel(true);
678+ $event->shouldCancel(true);
675679 })
676680 ->after(function(PostRunEvent $event) {
677681 // Do what you want
You can’t perform that action at this time.
0 commit comments