que 0.12.0 → 0.12.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +4 -1
- data/CHANGELOG.md +4 -0
- data/lib/que.rb +7 -1
- data/lib/que/adapters/active_record.rb +10 -1
- data/lib/que/sql.rb +20 -2
- data/lib/que/version.rb +1 -1
- data/spec/spec_helper.rb +1 -0
- 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: ec4ff01c0a08ebea8aef1fd75f2948ddabd49794
|
4
|
+
data.tar.gz: b5a5ab2a2276606a5b9b2252690aa97bbaacaf9e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 443ffec355bf4e0ff62734ee6ebf6c5e7665396f98e426696efedeb7b32c556aa7b8976893f799f05ba974c3cdf3509f7f1cf3dea19ddec72ee956879d96ad5c
|
7
|
+
data.tar.gz: 0bdafbc30cb5b538290d9cf1387fbceebd00d2e62d6e89546228f59b7c81e450d825ebb21856142ba11a348b147e3a8be9e751af50b262c64844496d4e3cedde
|
data/.travis.yml
CHANGED
@@ -5,8 +5,11 @@ rvm:
|
|
5
5
|
- "2.1"
|
6
6
|
- "2.2"
|
7
7
|
- "2.3"
|
8
|
+
- "2.4"
|
8
9
|
- "rbx-2"
|
9
|
-
- "
|
10
|
+
- "rbx"
|
11
|
+
- "jruby-1.7"
|
12
|
+
- "jruby"
|
10
13
|
before_script:
|
11
14
|
- psql -c 'create database "que-test"' -U postgres
|
12
15
|
- bundle exec ruby -r sequel -r ./lib/que -e 'Que.connection=Sequel.connect("postgres://localhost/que-test"); Que.migrate!'
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
### 0.12.1 (2017-01-22)
|
2
|
+
|
3
|
+
* Fix incompatibility with Rails 5.0. (#166) (nbibler, thedarkone)
|
4
|
+
|
1
5
|
### 0.12.0 (2016-09-09)
|
2
6
|
|
3
7
|
* The error_handler configuration option has been renamed to error_notifier, which is more descriptive of what it's actually supposed to do. You can still use error_handler for configuration, but you'll get a warning.
|
data/lib/que.rb
CHANGED
@@ -84,7 +84,13 @@ module Que
|
|
84
84
|
end
|
85
85
|
|
86
86
|
def worker_states
|
87
|
-
|
87
|
+
adapter.checkout do |conn|
|
88
|
+
if conn.server_version >= 90600
|
89
|
+
execute :worker_states_96
|
90
|
+
else
|
91
|
+
execute :worker_states_95
|
92
|
+
end
|
93
|
+
end
|
88
94
|
end
|
89
95
|
|
90
96
|
# Give us a cleaner interface when specifying a job_class as a string.
|
@@ -59,7 +59,16 @@ module Que
|
|
59
59
|
private
|
60
60
|
|
61
61
|
def checkout_activerecord_adapter(&block)
|
62
|
-
|
62
|
+
# Use Rails' executor (if present) to make sure that the connection
|
63
|
+
# we're using isn't taken from us while the block runs. See
|
64
|
+
# https://github.com/chanks/que/issues/166#issuecomment-274218910
|
65
|
+
if defined?(Rails.application.executor)
|
66
|
+
Rails.application.executor.wrap do
|
67
|
+
::ActiveRecord::Base.connection_pool.with_connection(&block)
|
68
|
+
end
|
69
|
+
else
|
70
|
+
::ActiveRecord::Base.connection_pool.with_connection(&block)
|
71
|
+
end
|
63
72
|
end
|
64
73
|
end
|
65
74
|
end
|
data/lib/que/sql.rb
CHANGED
@@ -131,7 +131,7 @@ module Que
|
|
131
131
|
ORDER BY count(*) DESC
|
132
132
|
}.freeze,
|
133
133
|
|
134
|
-
:
|
134
|
+
:worker_states_95 => %{
|
135
135
|
SELECT que_jobs.*,
|
136
136
|
pg.pid AS pg_backend_pid,
|
137
137
|
pg.state AS pg_state,
|
@@ -147,6 +147,24 @@ module Que
|
|
147
147
|
JOIN pg_stat_activity USING (pid)
|
148
148
|
WHERE locktype = 'advisory'
|
149
149
|
) pg USING (job_id)
|
150
|
-
}.freeze
|
150
|
+
}.freeze,
|
151
|
+
|
152
|
+
:worker_states_96 => %{
|
153
|
+
SELECT que_jobs.*,
|
154
|
+
pg.pid AS pg_backend_pid,
|
155
|
+
pg.state AS pg_state,
|
156
|
+
pg.state_change AS pg_state_changed_at,
|
157
|
+
pg.query AS pg_last_query,
|
158
|
+
pg.query_start AS pg_last_query_started_at,
|
159
|
+
pg.xact_start AS pg_transaction_started_at,
|
160
|
+
pg.wait_event_type IS NOT NULL AS pg_waiting_on_lock
|
161
|
+
FROM que_jobs
|
162
|
+
JOIN (
|
163
|
+
SELECT (classid::bigint << 32) + objid::bigint AS job_id, pg_stat_activity.*
|
164
|
+
FROM pg_locks
|
165
|
+
JOIN pg_stat_activity USING (pid)
|
166
|
+
WHERE locktype = 'advisory'
|
167
|
+
) pg USING (job_id)
|
168
|
+
}.freeze,
|
151
169
|
}.freeze
|
152
170
|
end
|
data/lib/que/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: que
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.12.
|
4
|
+
version: 0.12.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Hanks
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|