|
96 | 96 | # Do not dump schema after migrations.
|
97 | 97 | config.active_record.dump_schema_after_migration = false
|
98 | 98 |
|
99 |
| - config.good_job.enable_cron = true |
| 99 | + config.good_job.enable_cron = false |
100 | 100 | config.good_job.cron = {
|
101 |
| - # Every 15 minutes, enqueue `ExampleJob.set(priority: -10).perform_later(42, "life", name: "Alice")` |
102 |
| - frequent_task: { # each recurring job must have a unique key |
103 |
| - cron: "*/1 * * * *", # cron-style scheduling format by fugit gem |
104 |
| - class: "BlingOrderItemCreatorJob", # name of the job class as a String; must reference an Active Job job class |
105 |
| - args: [1], # positional arguments to pass to the job; can also be a proc e.g. `-> { [Time.now] }` |
106 |
| - set: { priority: -10 }, # additional Active Job properties; can also be a lambda/proc e.g. `-> { { priority: [1,2].sample } }` |
107 |
| - description: "Create Order Items per situation", # optional description that appears in Dashboard |
| 101 | + product_sync_job: { |
| 102 | + cron: "*/10 * * * *", |
| 103 | + class: "ProductSyncJob", |
| 104 | + args: [1], |
| 105 | + set: { priority: 1 }, |
| 106 | + description: "Synchronize products" |
108 | 107 | },
|
| 108 | + |
| 109 | + in_progress_order_items_task: { # each recurring job must have a unique key |
| 110 | + cron: "*/2 * * * *", # cron-style scheduling format by fugit gem |
| 111 | + class: "InProgressOrderItemsJob", # name of the job class as a String; must reference an Active Job job class |
| 112 | + args: [1], # positional arguments to pass to the job; can also be a proc e.g. `-> { [Time.now] }` |
| 113 | + set: { priority: 1 }, # additional Active Job properties; can also be a lambda/proc e.g. `-> { { priority: [1,2].sample } }` |
| 114 | + description: "Create Order Items with status in progress" # optional description that appears in Dashboard |
| 115 | + }, |
| 116 | + |
| 117 | + weekly_pending_order_items_task: { |
| 118 | + cron: "*/4 * * * *", |
| 119 | + class: "PendingOrderItemsJob", |
| 120 | + args: [1, { dataInicial: (Date.today - 3.weeks).strftime, dataFinal: Date.today.strftime }], |
| 121 | + set: { priority: 1 }, |
| 122 | + description: "Create Order Items with pending status from current week" |
| 123 | + }, |
| 124 | + |
| 125 | + general_pending_order_items_task: { |
| 126 | + cron: "@monthly", |
| 127 | + class: "PendingOrderItemsJob", |
| 128 | + args: [1], |
| 129 | + set: { priority: 1 }, |
| 130 | + description: "Create Order Items with pending status considering all period" |
| 131 | + }, |
| 132 | + |
| 133 | + printed_order_items_task: { # each recurring job must have a unique key |
| 134 | + cron: "*/2 * * * *", # cron-style scheduling format by fugit gem |
| 135 | + class: "PrintedOrderItemsJob", # name of the job class as a String; must reference an Active Job job class |
| 136 | + args: [1], # positional arguments to pass to the job; can also be a proc e.g. `-> { [Time.now] }` |
| 137 | + set: { priority: 1 }, # additional Active Job properties; can also be a lambda/proc e.g. `-> { { priority: [1,2].sample } }` |
| 138 | + description: "Create Order Items with printed status" # optional description that appears in Dashboard |
| 139 | + }, |
| 140 | + |
| 141 | + current_done_order_items_task: { # each recurring job must have a unique key |
| 142 | + cron: "*/2 * * * *", # cron-style scheduling format by fugit gem |
| 143 | + class: "CurrentDoneBlingOrderItemJob", # name of the job class as a String; must reference an Active Job job class |
| 144 | + args: [1], # positional arguments to pass to the job; can also be a proc e.g. `-> { [Time.now] }` |
| 145 | + set: { priority: 1 }, # additional Active Job properties; can also be a lambda/proc e.g. `-> { { priority: [1,2].sample } }` |
| 146 | + description: "Create Order Items statuses are checked and verified" # optional description that appears in Dashboard |
| 147 | + }, |
| 148 | + general_canceled_order_items_task: { # each recurring job must have a unique key |
| 149 | + cron: "@monthly", # cron-style scheduling format by fugit gem |
| 150 | + class: "CanceledBlingOrderItemsJob", # name of the job class as a String; must reference an Active Job job class |
| 151 | + args: [1], # positional arguments to pass to the job; can also be a proc e.g. `-> { [Time.now] }` |
| 152 | + set: { priority: 1 }, # additional Active Job properties; can also be a lambda/proc e.g. `-> { { priority: [1,2].sample } }` |
| 153 | + description: "Create Order Items statuses are canceled" # optional description that appears in Dashboard |
| 154 | + }, |
| 155 | + |
| 156 | + weekly_canceled_order_items_task: { # each recurring job must have a unique key |
| 157 | + cron: "*/4 * * * *", # cron-style scheduling format by fugit gem |
| 158 | + class: "WeeklyCanceledOrderItemsJob", # name of the job class as a String; must reference an Active Job job class |
| 159 | + args: [1, { dataInicial: 3.weeks.ago.to_date.strftime, dataFinal: Date.today.strftime }], # positional arguments to pass to the job; can also be a proc e.g. `-> { [Time.now] }` |
| 160 | + set: { priority: 1 }, # additional Active Job properties; can also be a lambda/proc e.g. `-> { { priority: [1,2].sample } }` |
| 161 | + description: "Create Order Items statuses are canceled" # optional description that appears in Dashboard |
| 162 | + }, |
| 163 | + |
| 164 | + daily_canceled_order_task: { |
| 165 | + cron: "*/10 * * * *", |
| 166 | + class: "DailyCanceledOrderJob", |
| 167 | + args: [1, Date.today], |
| 168 | + set: { priority: 1 }, |
| 169 | + description: "Create Order Items statuses are canceled at current day" |
| 170 | + }, |
| 171 | + |
| 172 | + checked_order_items_task: { |
| 173 | + cron: "@weekly", |
| 174 | + class: "CheckedBlingOrderItemsJob", |
| 175 | + args: [1], |
| 176 | + set: { priority: 3 }, |
| 177 | + description: "Create Order Items statuses are checked" |
| 178 | + }, |
| 179 | + |
| 180 | + frequent_checked_order_items_task: { |
| 181 | + cron: "*/2 * * * *", |
| 182 | + class: "CheckedBlingOrderItemsJob", |
| 183 | + args: [1, (Date.today - 5.days)], |
| 184 | + set: { priority: 1 }, |
| 185 | + description: "Create Order Items statuses are checked" |
| 186 | + }, |
| 187 | + |
| 188 | + verified_order_items_task: { |
| 189 | + cron: "@weekly", |
| 190 | + class: "VerifiedBlingOrderItemsJob", |
| 191 | + args: [1], |
| 192 | + set: { priority: 4 }, |
| 193 | + description: "Create Order Items whose statuses are verified" |
| 194 | + } |
109 | 195 | # etc.
|
110 | 196 | }
|
111 | 197 | end
|
0 commit comments