que 0.11.5 → 0.11.6
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/CHANGELOG.md +4 -0
- data/docs/README.md +31 -31
- data/lib/que/adapters/active_record.rb +8 -0
- data/lib/que/version.rb +1 -1
- data/spec/adapters/active_record_spec.rb +13 -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: 1d29adfcb566361924bbd594ba6e5c7b93006060
|
4
|
+
data.tar.gz: 65905d420760dcafc00411f895d6140262d9beb1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 729dcc64222ed6c9c1d528e72ad4195a9b66aa2275372143f0add9ad051977e967dad6b5dbced2dec86a714553a2994fe2e12e4a2f03224751e2d9670f97d05b
|
7
|
+
data.tar.gz: 1ffb694bd34229a657e203256e85556b9e84bc293681e71cbb80d98cbf21003651d0d9b80d67f34f0849f2f863743a8d08a5bb24a24e7ae6ed7ec7eaa3f149fb
|
data/CHANGELOG.md
CHANGED
data/docs/README.md
CHANGED
@@ -1,33 +1,33 @@
|
|
1
1
|
Docs Index
|
2
|
-
|
2
|
+
===============
|
3
3
|
|
4
|
-
- [Advanced Setup](
|
5
|
-
- Using ActiveRecord Without Rails
|
6
|
-
- Forking Servers
|
7
|
-
- Managing the Jobs Table
|
8
|
-
- Other Setup
|
9
|
-
- [Customizing Que](
|
10
|
-
- Recurring Jobs
|
11
|
-
- DelayedJob-style Jobs
|
12
|
-
- QueueClassic-style Jobs
|
13
|
-
- Retaining Finished Jobs
|
14
|
-
- Not Retrying Certain Failed Jobs
|
15
|
-
- [Error Handling](
|
16
|
-
- [Inspecting the Queue](
|
17
|
-
- Job Stats
|
18
|
-
- Worker States
|
19
|
-
- Custom Queries
|
20
|
-
- [Logging](
|
21
|
-
- [Managing Workers](
|
22
|
-
- Working Jobs Via Executable
|
23
|
-
- Thread-Unsafe Application Code
|
24
|
-
- The Wake Interval
|
25
|
-
- Manually Waking Workers
|
26
|
-
- Connection Pool Size
|
27
|
-
- [Migrating](
|
28
|
-
- [Multiple Queues](
|
29
|
-
- [Shutting Down Safely](
|
30
|
-
- [Using Plain Postgres Connections](
|
31
|
-
- [Using Sequel](
|
32
|
-
- [Writing Reliable Jobs](
|
33
|
-
- Timeouts
|
4
|
+
- [Advanced Setup](advanced_setup.md#advanced-setup)
|
5
|
+
- [Using ActiveRecord Without Rails](advanced_setup.md#using-activerecord-without-rails)
|
6
|
+
- [Forking Servers](advanced_setup.md#forking-servers)
|
7
|
+
- [Managing the Jobs Table](advanced_setup.md#managing-the-jobs-table)
|
8
|
+
- [Other Setup](advanced_setup.md#other-setup)
|
9
|
+
- [Customizing Que](customizing_que.md#customizing-que)
|
10
|
+
- [Recurring Jobs](customizing_que.md#recurring-jobs)
|
11
|
+
- [DelayedJob-style Jobs](customizing_que.md#delayedjob-style-jobs)
|
12
|
+
- [QueueClassic-style Jobs](customizing_que.md#queueclassic-style-jobs)
|
13
|
+
- [Retaining Finished Jobs](customizing_que.md#retaining-finished-jobs)
|
14
|
+
- [Not Retrying Certain Failed Jobs](customizing_que.md#not-retrying-certain-failed-jobs)
|
15
|
+
- [Error Handling](error_handling.md#error-handling)
|
16
|
+
- [Inspecting the Queue](inspecting_the_queue.md#inspecting-the-queue)
|
17
|
+
- [Job Stats](inspecting_the_queue.md#job-stats)
|
18
|
+
- [Worker States](inspecting_the_queue.md#worker-states)
|
19
|
+
- [Custom Queries](inspecting_the_queue.md#custom-queries)
|
20
|
+
- [Logging](logging.md#logging)
|
21
|
+
- [Managing Workers](managing_workers.md#managing-workers)
|
22
|
+
- [Working Jobs Via Executable](managing_workers.md#working-jobs-via-executable)
|
23
|
+
- [Thread-Unsafe Application Code](managing_workers.md#thread-unsafe-application-code)
|
24
|
+
- [The Wake Interval](managing_workers.md#the-wake-interval)
|
25
|
+
- [Manually Waking Workers](managing_workers.md#manually-waking-workers)
|
26
|
+
- [Connection Pool Size](managing_workers.md#connection-pool-size)
|
27
|
+
- [Migrating](migrating.md#migrating)
|
28
|
+
- [Multiple Queues](multiple_queues.md#multiple-queues)
|
29
|
+
- [Shutting Down Safely](shutting_down_safely.md#shutting-down-safely)
|
30
|
+
- [Using Plain Postgres Connections](using_plain_connections.md#using-plain-postgres-connections)
|
31
|
+
- [Using Sequel](using_sequel.md#using-sequel)
|
32
|
+
- [Writing Reliable Jobs](writing_reliable_jobs.md#writing-reliable-jobs)
|
33
|
+
- [Timeouts](writing_reliable_jobs.md#timeouts)
|
@@ -46,6 +46,14 @@ module Que
|
|
46
46
|
def before_committed!(*)
|
47
47
|
# no-op
|
48
48
|
end
|
49
|
+
|
50
|
+
def add_to_transaction
|
51
|
+
# no-op.
|
52
|
+
#
|
53
|
+
# This is called when we're in a nested transaction. Ideally we would
|
54
|
+
# `wake!` when the outer transaction gets committed, but that would be
|
55
|
+
# a bigger refactor!
|
56
|
+
end
|
49
57
|
end
|
50
58
|
|
51
59
|
private
|
data/lib/que/version.rb
CHANGED
@@ -6,7 +6,7 @@ unless defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby'
|
|
6
6
|
require 'spec_helper'
|
7
7
|
require 'active_record'
|
8
8
|
|
9
|
-
if ActiveRecord.version.release >= Gem::Version.new('4.2')
|
9
|
+
if ActiveRecord.version.release >= Gem::Version.new('4.2') && ActiveRecord.version.release < Gem::Version.new('5.0')
|
10
10
|
ActiveRecord::Base.raise_in_transactional_callbacks = true
|
11
11
|
end
|
12
12
|
ActiveRecord::Base.establish_connection(QUE_URL)
|
@@ -103,12 +103,24 @@ unless defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby'
|
|
103
103
|
Que::Job.enqueue
|
104
104
|
sleep_until { Que::Worker.workers.all?(&:sleeping?) && DB[:que_jobs].empty? }
|
105
105
|
|
106
|
+
# Wakes a worker on transaction commit when in a transaction.
|
106
107
|
ActiveRecord::Base.transaction do
|
107
108
|
Que::Job.enqueue
|
108
109
|
Que::Worker.workers.each { |worker| worker.should be_sleeping }
|
109
110
|
end
|
110
111
|
sleep_until { Que::Worker.workers.all?(&:sleeping?) && DB[:que_jobs].empty? }
|
111
112
|
|
113
|
+
# Does nothing when in a nested transaction.
|
114
|
+
# TODO: ideally this would wake after the outer transaction commits
|
115
|
+
if ActiveRecord.version.release >= Gem::Version.new('5.0')
|
116
|
+
ActiveRecord::Base.transaction do
|
117
|
+
ActiveRecord::Base.transaction(requires_new: true) do
|
118
|
+
Que::Job.enqueue
|
119
|
+
Que::Worker.workers.each { |worker| worker.should be_sleeping }
|
120
|
+
end
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
112
124
|
# Do nothing when queueing with a specific :run_at.
|
113
125
|
BlockJob.enqueue :run_at => Time.now
|
114
126
|
Que::Worker.workers.each { |worker| worker.should be_sleeping }
|
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.11.
|
4
|
+
version: 0.11.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Hanks
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-07-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|