delayed_job_nobrainer 0.1.3 → 0.1.4
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 -19
- data/delayed_job_nobrainer.gemspec +1 -1
- data/lib/delayed/backend/nobrainer.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f6035ea4270feff55c9d7bed02b4f3c02288c46
|
4
|
+
data.tar.gz: a599a4fa9ed51e57241f9f47b590fce1ba46e306
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee7b7499cfc2dec8ff0ef15858d87dadb98cd5d8d3689b8747aaaa77c072c1975ca297513bb0d62abea5020fcec7fd5fdc7539fd1bfa48b5b5f0c94ed57abb3f
|
7
|
+
data.tar.gz: 61427131e1f2bc5a1b62dde89f5b6015460e524b6a4fb51c150905f5d062f0e7e15c00b082626eb177daec1f3e658b03f79d718dec0eee49751b706a04d0bc99
|
data/README.md
CHANGED
@@ -2,32 +2,23 @@
|
|
2
2
|
|
3
3
|
This backend runs DelayedJob on top of RethinkDB (https://rethinkdb.com) by using NoBrainer (http://nobrainer.io) as ORM layer.
|
4
4
|
|
5
|
+
## Status
|
6
|
+
Please note that the tests are currently not passing. They are leftovers from the original delayed_job_active_record backend, which I used as template. I will fix them as soon as possible!
|
7
|
+
But the backend works in my current testing environment and will be used for the production version of my project until end of January 2018. Thus, you can expect them as stable.
|
8
|
+
If you find any issues: Please file a bug report.
|
9
|
+
|
5
10
|
## Installation
|
6
11
|
|
7
12
|
Add the gem to your Gemfile:
|
8
13
|
|
9
|
-
gem '
|
14
|
+
gem 'delayed_job_nobrainer'
|
10
15
|
|
11
16
|
Run `bundle install`.
|
12
17
|
|
13
|
-
|
14
|
-
delayed_job table.
|
15
|
-
|
16
|
-
rails g delayed_job:active_record
|
17
|
-
rake db:migrate
|
18
|
-
|
19
|
-
## Problems locking jobs
|
20
|
-
|
21
|
-
You can try using the legacy locking code. It is usually slower but works better for certain people.
|
22
|
-
|
23
|
-
Delayed::Backend::ActiveRecord.configuration.reserve_sql_strategy = :default_sql
|
24
|
-
|
25
|
-
## Upgrading from 2.x to 3.0.0
|
18
|
+
That's it. Use [delayed_job as normal](http://github.com/collectiveidea/delayed_job).
|
26
19
|
|
27
|
-
|
28
|
-
|
20
|
+
## Rails >= 4.2
|
21
|
+
DelayedJob supports ActiveJobs. In order to use this backend, you only have to add the following line into your 'configuration/application.rb':
|
29
22
|
|
30
|
-
|
31
|
-
rake db:migrate
|
23
|
+
config.active_job.queue_adapter = :delayed_job
|
32
24
|
|
33
|
-
That's it. Use [delayed_job as normal](http://github.com/collectiveidea/delayed_job).
|
@@ -62,7 +62,7 @@ module Delayed
|
|
62
62
|
filter_hash = filter_hash.merge({:priority.le => Worker.max_priority}) if Worker.max_priority
|
63
63
|
filter_hash = filter_hash.merge({:queue.in => Worker.queues}) if Worker.queues.any?
|
64
64
|
|
65
|
-
job = where(filter_hash).order_by(:priority => :asc).first
|
65
|
+
job = where(filter_hash).order_by(:priority => :asc).order_by(:created_at => :asc).first
|
66
66
|
job.update(locked_at: Time.now, locked_by: worker.name) unless job.nil?
|
67
67
|
job
|
68
68
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: delayed_job_nobrainer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stefan Eilers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-01-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nobrainer
|