-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
It would be very helpful to be able to enable or disable cron jobs based on the current environment or specific environment variable values.
(e.g., Laravel’s Scheduler via ->environment() or ->when() methods).
You might want certain jobs to run only in production or to disable certain jobs in development/testing.
Additionally, being able to toggle a job via an environment variable (e.g., CRON_TASK1_ENABLED=0).
cron:
jobs:
- name: "cache-warmup"
command: "php artisan cache:warmup"
schedule: "0 */6 * * *"
# Conditionally enabled via an env variable
enabled_if_env: "CRON_TASK1_ENABLED=1"
# Or only on production environment
enabled_if_env: ["production"] # alias for `APP_ENV=production`Metadata
Metadata
Assignees
Labels
No labels