File tree 1 file changed +6
-2
lines changed
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::
652
652
#[AsSchedule('uptoyou')]
653
653
class SaleTaskProvider implements ScheduleProviderInterface
654
654
{
655
+ public function __construct(private EventDispatcherInterface $dispatcher)
656
+ {
657
+ }
658
+
655
659
public function getSchedule(): Schedule
656
660
{
657
661
$this->removeOldReports = RecurringMessage::cron('3 8 * * 1', new CleanUpOldSalesReport());
658
662
659
- return $this->schedule ??= (new Schedule())
663
+ return $this->schedule ??= (new Schedule($this->dispatcher ))
660
664
->with(
661
665
// ...
662
666
)
@@ -671,7 +675,7 @@ being transferred and processed by its handler::
671
675
$schedule->removeById($messageContext->id);
672
676
673
677
// allow to call the ShouldCancel() and avoid the message to be handled
674
- $event->shouldCancel(true);
678
+ $event->shouldCancel(true);
675
679
})
676
680
->after(function(PostRunEvent $event) {
677
681
// Do what you want
You can’t perform that action at this time.
0 commit comments