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::
624
624
#[AsSchedule('uptoyou')]
625
625
class SaleTaskProvider implements ScheduleProviderInterface
626
626
{
627
+ public function __construct(private EventDispatcherInterface $dispatcher)
628
+ {
629
+ }
630
+
627
631
public function getSchedule(): Schedule
628
632
{
629
633
$this->removeOldReports = RecurringMessage::cron('3 8 * * 1', new CleanUpOldSalesReport());
630
634
631
- return $this->schedule ??= (new Schedule())
635
+ return $this->schedule ??= (new Schedule($this->dispatcher ))
632
636
->with(
633
637
// ...
634
638
)
@@ -643,7 +647,7 @@ being transferred and processed by its handler::
643
647
$schedule->removeById($messageContext->id);
644
648
645
649
// allow to call the ShouldCancel() and avoid the message to be handled
646
- $event->shouldCancel(true);
650
+ $event->shouldCancel(true);
647
651
})
648
652
->after(function(PostRunEvent $event) {
649
653
// Do what you want
You can’t perform that action at this time.
0 commit comments