diff --git a/composer.json b/composer.json index ab73c1e..3c09cc8 100644 --- a/composer.json +++ b/composer.json @@ -74,7 +74,8 @@ "twig/intl-extra": "^3.7", "twig/string-extra": "^3.7", "twig/twig": "^2.12|^3.0", - "voku/anti-xss": "^4.1" + "voku/anti-xss": "^4.1", + "zenstruck/schedule-bundle": "^1.8" }, "config": { "allow-plugins": { diff --git a/composer.lock b/composer.lock index 1d1cff6..3dc8389 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "57ad3e9efdaa066d552366d2c5d6a6fa", + "content-hash": "70ed457986ca0bc2ea7d78074b2e050a", "packages": [ { "name": "beberlei/doctrineextensions", @@ -1532,6 +1532,71 @@ }, "time": "2025-01-24T11:45:48+00:00" }, + { + "name": "dragonmantank/cron-expression", + "version": "v3.4.0", + "source": { + "type": "git", + "url": "https://github.com/dragonmantank/cron-expression.git", + "reference": "8c784d071debd117328803d86b2097615b457500" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/8c784d071debd117328803d86b2097615b457500", + "reference": "8c784d071debd117328803d86b2097615b457500", + "shasum": "" + }, + "require": { + "php": "^7.2|^8.0", + "webmozart/assert": "^1.0" + }, + "replace": { + "mtdowling/cron-expression": "^1.0" + }, + "require-dev": { + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^1.0", + "phpunit/phpunit": "^7.0|^8.0|^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Cron\\": "src/Cron/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Chris Tankersley", + "email": "chris@ctankersley.com", + "homepage": "https://github.com/dragonmantank" + } + ], + "description": "CRON for PHP: Calculate the next or previous run date and determine if a CRON expression is due", + "keywords": [ + "cron", + "schedule" + ], + "support": { + "issues": "https://github.com/dragonmantank/cron-expression/issues", + "source": "https://github.com/dragonmantank/cron-expression/tree/v3.4.0" + }, + "funding": [ + { + "url": "https://github.com/dragonmantank", + "type": "github" + } + ], + "time": "2024-10-09T13:47:03+00:00" + }, { "name": "egulias/email-validator", "version": "4.0.4", @@ -10824,6 +10889,85 @@ "source": "https://github.com/webmozarts/assert/tree/1.11.0" }, "time": "2022-06-03T18:03:27+00:00" + }, + { + "name": "zenstruck/schedule-bundle", + "version": "v1.8.1", + "source": { + "type": "git", + "url": "https://github.com/zenstruck/schedule-bundle.git", + "reference": "c82f4d3e96566260796975a90a8d8075fca681c9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zenstruck/schedule-bundle/zipball/c82f4d3e96566260796975a90a8d8075fca681c9", + "reference": "c82f4d3e96566260796975a90a8d8075fca681c9", + "shasum": "" + }, + "require": { + "dragonmantank/cron-expression": "^2.3|^3.0", + "php": ">=8.0", + "symfony/console": "^5.4|^6.0|^7.0", + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/event-dispatcher": "^5.4|^6.0|^7.0", + "symfony/http-kernel": "^5.4|^6.0|^7.0" + }, + "require-dev": { + "lorisleiva/cron-translator": "^0.1.0|^0.3.1|^0.4.0", + "matthiasnoback/symfony-dependency-injection-test": "^4.1|^5.0", + "phpstan/phpstan": "^1.4", + "phpunit/phpunit": "^9.5", + "psr/log": "^1.1", + "symfony/framework-bundle": "^5.4|^6.0|^7.0", + "symfony/http-client": "^5.4|^6.0|^7.0", + "symfony/lock": "^5.4|^6.0|^7.0", + "symfony/mailer": "^5.4|^6.0|^7.0", + "symfony/messenger": "^5.4|^6.0|^7.0", + "symfony/notifier": "^5.4|^6.0|^7.0", + "symfony/phpunit-bridge": "^6.2|^7.0", + "symfony/process": "^5.4|^6.0|^7.0" + }, + "suggest": { + "lorisleiva/cron-translator": "Displays human readable cron expression in schedule:list", + "symfony/http-client": "Allows usage of ping* extensions", + "symfony/lock": "Allows usage of withoutOverlapping and onSingleServer extensions", + "symfony/mailer": "Allows usage of email* extensions", + "symfony/notifier": "Allows usage of notify* extensions", + "symfony/process": "Allows usage of ProcessTask" + }, + "type": "symfony-bundle", + "autoload": { + "psr-4": { + "Zenstruck\\ScheduleBundle\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kevin Bond", + "email": "kevinbond@gmail.com" + } + ], + "description": "Schedule Cron jobs (commands/callbacks/bash scripts) within your Symfony application.", + "homepage": "https://github.com/zenstruck/schedule-bundle", + "keywords": [ + "cron", + "schedule" + ], + "support": { + "issues": "https://github.com/zenstruck/schedule-bundle/issues", + "source": "https://github.com/zenstruck/schedule-bundle/tree/v1.8.1" + }, + "funding": [ + { + "url": "https://github.com/kbond", + "type": "github" + } + ], + "time": "2025-04-27T22:34:07+00:00" } ], "packages-dev": [ diff --git a/config/bundles.php b/config/bundles.php index 6cd191c..4e18a4f 100644 --- a/config/bundles.php +++ b/config/bundles.php @@ -21,4 +21,5 @@ return [ Symfony\UX\TwigComponent\TwigComponentBundle::class => ['all' => true], Flagception\Bundle\FlagceptionBundle\FlagceptionBundle::class => ['all' => true], League\FlysystemBundle\FlysystemBundle::class => ['all' => true], + Zenstruck\ScheduleBundle\ZenstruckScheduleBundle::class => ['all' => true], ]; diff --git a/config/packages/zenstruck_schedule.yaml b/config/packages/zenstruck_schedule.yaml new file mode 100644 index 0000000..510977a --- /dev/null +++ b/config/packages/zenstruck_schedule.yaml @@ -0,0 +1,34 @@ +zenstruck_schedule: + timezone: Europe/Berlin + + mailer: + service: mailer + + schedule_extensions: + email_on_failure: + to: fromme@dreipunktnull.com + + tasks: + - task: app:bpn-import + frequency: '30 1 * * *' + description: "Imports dates, products and hotels from BusProNet" + + - task: app:cron + frequency: '35 1 * * *' + description: "Executes several tasks triggered on a daily basis" + + - task: app:teamer-status + frequency: '40 1 * * *' + description: "Updates status of teamers depending on their disposition" + + - task: oneup:uploader:clear-orphans + frequency: '30 * * * *' + description: "Removes orphaned uploads" + + - task: messenger:consume async -t 60 + frequency: '*/5 * * * *' + description: "Starts messenger queue" + + - task: 'bash:%kernel.project_dir%/../bin/bpn-download-xml.sh' + frequency: '0 */4 * * *' + description: "Downloads XML data" diff --git a/symfony.lock b/symfony.lock index 1492670..51a40c8 100644 --- a/symfony.lock +++ b/symfony.lock @@ -434,5 +434,8 @@ }, "twig/extra-bundle": { "version": "v3.6.1" + }, + "zenstruck/schedule-bundle": { + "version": "v1.8.1" } }