From 2cf1de8e1935f3133e634e65c697c68467256446 Mon Sep 17 00:00:00 2001 From: Matthias Krauser Date: Mon, 5 Feb 2024 10:08:57 +0100 Subject: [PATCH] #19510 in symfony 6.3 there was no Schedule::with(...), but Schedule::add(...) --- scheduler.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scheduler.rst b/scheduler.rst index f37568fd4dd..db48ee2c5aa 100644 --- a/scheduler.rst +++ b/scheduler.rst @@ -318,7 +318,7 @@ Finally, the recurring messages has to be attached to a schedule:: public function getSchedule(): Schedule { return $this->schedule ??= (new Schedule()) - ->with( + ->add( RecurringMessage::trigger( new ExcludeHolidaysTrigger( CronExpressionTrigger::fromSpec('@daily'), @@ -404,7 +404,7 @@ a worker is restarted, it resumes from the point it left off:: $this->removeOldReports = RecurringMessage::cron('3 8 * * 1', new CleanUpOldSalesReport()); return $this->schedule ??= (new Schedule()) - ->with( + ->add( // ... ) ->stateful($this->cache) @@ -426,7 +426,7 @@ same task more than once:: $this->removeOldReports = RecurringMessage::cron('3 8 * * 1', new CleanUpOldSalesReport()); return $this->schedule ??= (new Schedule()) - ->with( + ->add( // ... ) ->lock($this->lockFactory->createLock('my-lock') @@ -453,7 +453,7 @@ before being further redispatched to its corresponding handler:: public function getSchedule(): Schedule { return $this->schedule ??= (new Schedule()) - ->with( + ->add( RecurringMessage::every('5 seconds'), new RedispatchMessage(new Message(), 'async') );