File tree Expand file tree Collapse file tree 3 files changed +41
-1
lines changed Expand file tree Collapse file tree 3 files changed +41
-1
lines changed Original file line number Diff line number Diff line change 22 "type" : " project" ,
33 "license" : " proprietary" ,
44 "require" : {
5- "php" : " >=8.1 " ,
5+ "php" : " >=8.3 " ,
66 "ext-ctype" : " *" ,
77 "ext-iconv" : " *" ,
88 "composer/package-versions-deprecated" : " 1.11.99.1" ,
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace App ;
4+
5+ use Symfony \Component \Scheduler \Attribute \AsSchedule ;
6+ use Symfony \Component \Scheduler \Schedule as SymfonySchedule ;
7+ use Symfony \Component \Scheduler \ScheduleProviderInterface ;
8+ use Symfony \Contracts \Cache \CacheInterface ;
9+
10+ #[AsSchedule]
11+ class Schedule implements ScheduleProviderInterface
12+ {
13+ public function __construct (
14+ private CacheInterface $ cache ,
15+ ) {
16+ }
17+
18+ public function getSchedule (): SymfonySchedule
19+ {
20+ return (new SymfonySchedule ())
21+ ->stateful ($ this ->cache ) // ensure missed tasks are executed
22+ ->processOnlyLastMissedRun (true ) // ensure only last missed task is run
23+
24+ // add your own tasks here
25+ // see https://symfony.com/doc/current/scheduler.html#attaching-recurring-messages-to-a-schedule
26+ ;
27+ }
28+ }
Original file line number Diff line number Diff line change 433433 "config/routes.yaml"
434434 ]
435435 },
436+ "symfony/scheduler": {
437+ "version": "7.3",
438+ "recipe": {
439+ "repo": "github.com/symfony/recipes",
440+ "branch": "main",
441+ "version": "7.2",
442+ "ref": "caea3c928ee9e1b21288fd76aef36f16ea355515"
443+ },
444+ "files": [
445+ "src/Schedule.php"
446+ ]
447+ },
436448 "symfony/security-bundle": {
437449 "version": "5.4",
438450 "recipe": {
You can’t perform that action at this time.
0 commit comments