Skip to content

Commit

Permalink
Add per-environment keys in sample recurring configurations
Browse files Browse the repository at this point in the history
As suggested in #358
  • Loading branch information
rosa committed Sep 25, 2024
1 parent 9f1d309 commit 3e71f90
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -380,13 +380,14 @@ bin/jobs --recurring_schedule_file=config/schedule.yml
The configuration itself looks like this:

```yml
a_periodic_job:
class: MyJob
args: [ 42, { status: "custom_status" } ]
schedule: every second
a_cleanup_task:
command: "DeletedStuff.clear_all"
schedule: every day at 9am
production:
a_periodic_job:
class: MyJob
args: [ 42, { status: "custom_status" } ]
schedule: every second
a_cleanup_task:
command: "DeletedStuff.clear_all"
schedule: every day at 9am
```

Tasks are specified as a hash/dictionary, where the key will be the task's key internally. Each task needs to either have a `class`, which will be the job class to enqueue, or a `command`, which will be eval'ed in the context of a job (`SolidQueue::RecurringJob`) that will be enqueued according to its schedule, in the `solid_queue_recurring` queue.
Expand Down
19 changes: 10 additions & 9 deletions lib/generators/solid_queue/install/templates/config/recurring.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# periodic_cleanup:
# class: CleanSoftDeletedRecordsJob
# queue: background
# args: [ 1000, { batch_size: 500 } ]
# schedule: every hour
# periodic_command:
# command: "SoftDeletedRecord.due.delete_all"
# priority: 2
# schedule: at 5am every day
# production:
# periodic_cleanup:
# class: CleanSoftDeletedRecordsJob
# queue: background
# args: [ 1000, { batch_size: 500 } ]
# schedule: every hour
# periodic_command:
# command: "SoftDeletedRecord.due.delete_all"
# priority: 2
# schedule: at 5am every day

0 comments on commit 3e71f90

Please sign in to comment.