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 @@ -624,11 +624,15 @@ being transferred and processed by its handler::
624624 #[AsSchedule('uptoyou')]
625625 class SaleTaskProvider implements ScheduleProviderInterface
626626 {
627+ public function __construct(private EventDispatcherInterface $dispatcher)
628+ {
629+ }
630+
627631 public function getSchedule(): Schedule
628632 {
629633 $this->removeOldReports = RecurringMessage::cron('3 8 * * 1', new CleanUpOldSalesReport());
630634
631- return $this->schedule ??= (new Schedule())
635+ return $this->schedule ??= (new Schedule($this->dispatcher ))
632636 ->with(
633637 // ...
634638 )
@@ -643,7 +647,7 @@ being transferred and processed by its handler::
643647 $schedule->removeById($messageContext->id);
644648
645649 // allow to call the ShouldCancel() and avoid the message to be handled
646- $event->shouldCancel(true);
650+ $event->shouldCancel(true);
647651 })
648652 ->after(function(PostRunEvent $event) {
649653 // Do what you want
You can’t perform that action at this time.
0 commit comments