postburner 1.0.0.pre.18 → 1.0.0.pre.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +10 -3
- data/lib/postburner/version.rb +1 -1
- data/lib/postburner/worker.rb +27 -2
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8bbfdd062766071e8ab4069cbf651b0ebaf946a89fc87620c73f284a0cf4c539
|
|
4
|
+
data.tar.gz: ea5d14000cab0fa2493fd810076ca31a9b6843c97efbdaf295933e5dae411df4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 67d55a00a1cdc5e56aaca8087dde099f1e32f96ad3d4086f06eae5f3c694a27a013588e57f031c133ea779b6e8740bc5c0fd0267a7ad73af72628a0f173dde32
|
|
7
|
+
data.tar.gz: 5d5cd736f414f2fb24ed56ddbe46f4ff271e996ef5209d6d15a10b1cb2cefd61202aa3ec5e9355607e5751cca336a97bfa5414e7c231c69633a4398cdf49410e
|
data/README.md
CHANGED
|
@@ -126,7 +126,7 @@ Postburner [beanstalkd](https://beanstalkd.github.io/) is used with PostgreSQL t
|
|
|
126
126
|
|
|
127
127
|
```ruby
|
|
128
128
|
# Gemfile
|
|
129
|
-
gem 'postburner', '~> 1.0.0.pre.
|
|
129
|
+
gem 'postburner', '~> 1.0.0.pre.18'
|
|
130
130
|
|
|
131
131
|
# config/application.rb
|
|
132
132
|
config.active_job.queue_adapter = :postburner
|
|
@@ -2159,7 +2159,7 @@ beanstalkd -l 127.0.0.1 -p 11300 -b /var/lib/beanstalkd
|
|
|
2159
2159
|
|
|
2160
2160
|
```ruby
|
|
2161
2161
|
# Gemfile
|
|
2162
|
-
gem 'postburner', '~> 1.0.0.pre.
|
|
2162
|
+
gem 'postburner', '~> 1.0.0.pre.18'
|
|
2163
2163
|
```
|
|
2164
2164
|
|
|
2165
2165
|
```bash
|
|
@@ -2194,6 +2194,13 @@ Edit `config/postburner.yml` for your environment (see [Configuration](#configur
|
|
|
2194
2194
|
|
|
2195
2195
|
Key changes in v1.0:
|
|
2196
2196
|
|
|
2197
|
+
### Changed
|
|
2198
|
+
- `Postburner::Job#backburner_job` -> `Postburner::Job#bk`
|
|
2199
|
+
- `queue_priority` → `priority`
|
|
2200
|
+
- `queue_ttr` → `ttr`
|
|
2201
|
+
- `queue_max_job_retries` → `max_retries`
|
|
2202
|
+
- `queue_retry_delay` → `retry_delay`
|
|
2203
|
+
|
|
2197
2204
|
### Removed
|
|
2198
2205
|
- Backburner dependency
|
|
2199
2206
|
- `config/initializers/backburner.rb`
|
|
@@ -2210,7 +2217,7 @@ Key changes in v1.0:
|
|
|
2210
2217
|
|
|
2211
2218
|
1. **Update Gemfile:**
|
|
2212
2219
|
```ruby
|
|
2213
|
-
gem 'postburner', '~> 1.0.0.pre.
|
|
2220
|
+
gem 'postburner', '~> 1.0.0.pre.18'
|
|
2214
2221
|
```
|
|
2215
2222
|
|
|
2216
2223
|
2. **Remove Backburner config:**
|
data/lib/postburner/version.rb
CHANGED
data/lib/postburner/worker.rb
CHANGED
|
@@ -107,6 +107,7 @@ module Postburner
|
|
|
107
107
|
logger.info "[Postburner::Worker] Starting worker '#{worker_config[:name]}'..."
|
|
108
108
|
logger.info "[Postburner::Worker] Queues: #{config.queue_names.join(', ')}"
|
|
109
109
|
logger.info "[Postburner::Worker] Config: #{worker_config[:forks]} forks, #{worker_config[:threads]} threads, gc_limit: #{worker_config[:gc_limit] || 'unlimited'}, timeout: #{worker_config[:timeout]}s"
|
|
110
|
+
log_reloading_status
|
|
110
111
|
all_tubes = config.expanded_tube_names + [config.scheduler_tube_name]
|
|
111
112
|
logger.info "[Postburner] #{config.beanstalk_url} known tubes: #{all_tubes.join(', ')}"
|
|
112
113
|
log_next_scheduler_watchdog
|
|
@@ -192,6 +193,25 @@ module Postburner
|
|
|
192
193
|
config.expand_tube_name(queue_name)
|
|
193
194
|
end
|
|
194
195
|
|
|
196
|
+
# Logs whether Rails code reloading is enabled.
|
|
197
|
+
#
|
|
198
|
+
# In development, Rails reloads code between job executions, allowing
|
|
199
|
+
# code changes to take effect without restarting the worker.
|
|
200
|
+
#
|
|
201
|
+
# @return [void]
|
|
202
|
+
# @api private
|
|
203
|
+
def log_reloading_status
|
|
204
|
+
reloading_enabled = if Rails.application.config.respond_to?(:enable_reloading)
|
|
205
|
+
Rails.application.config.enable_reloading
|
|
206
|
+
else
|
|
207
|
+
!Rails.application.config.cache_classes
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
if reloading_enabled
|
|
211
|
+
logger.info "[Postburner::Worker] Code reloading enabled (development mode)"
|
|
212
|
+
end
|
|
213
|
+
end
|
|
214
|
+
|
|
195
215
|
# Logs info about the next scheduler watchdog job.
|
|
196
216
|
#
|
|
197
217
|
# Peeks at the scheduler tube to find the next watchdog job and logs
|
|
@@ -528,7 +548,10 @@ module Postburner
|
|
|
528
548
|
|
|
529
549
|
interval = payload['interval'] || 300
|
|
530
550
|
scheduler = Postburner::Scheduler.new(interval: interval, logger: logger)
|
|
531
|
-
|
|
551
|
+
|
|
552
|
+
Rails.application.reloader.wrap do
|
|
553
|
+
scheduler.perform
|
|
554
|
+
end
|
|
532
555
|
|
|
533
556
|
logger.info "[Postburner] Completed scheduler watchdog #{beanstalk_job.id}"
|
|
534
557
|
delete_job!(beanstalk_job)
|
|
@@ -559,7 +582,9 @@ module Postburner
|
|
|
559
582
|
ActiveSupport::Notifications.instrument('perform_start.job.postburner', instrument_payload)
|
|
560
583
|
|
|
561
584
|
ActiveSupport::Notifications.instrument('perform.job.postburner', instrument_payload) do
|
|
562
|
-
|
|
585
|
+
Rails.application.reloader.wrap do
|
|
586
|
+
Postburner::ActiveJob::Execution.execute(beanstalk_job.body)
|
|
587
|
+
end
|
|
563
588
|
end
|
|
564
589
|
|
|
565
590
|
logger.info "[Postburner] Completed #{job_description} (bkid: #{beanstalk_job.id})"
|