perfectqueue 0.8.9 → 0.8.10
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.
- data/ChangeLog +5 -0
- data/lib/perfectqueue/backend/rdb_compat.rb +4 -3
- data/lib/perfectqueue/version.rb +1 -1
- metadata +2 -2
data/ChangeLog
CHANGED
@@ -44,7 +44,7 @@ module PerfectQueue
|
|
44
44
|
}
|
45
45
|
|
46
46
|
@sql = <<SQL
|
47
|
-
SELECT id, timeout, data, created_at, resource, max_running/running AS weight
|
47
|
+
SELECT id, timeout, data, created_at, resource, max_running, max_running/running AS weight
|
48
48
|
FROM `#{@table}`
|
49
49
|
LEFT JOIN (
|
50
50
|
SELECT resource AS res, COUNT(1) AS running
|
@@ -92,7 +92,7 @@ SQL
|
|
92
92
|
now = (options[:now] || Time.now).to_i
|
93
93
|
|
94
94
|
connect {
|
95
|
-
row = @db.fetch("SELECT timeout, data, created_at, resource FROM `#{@table}` WHERE id=? LIMIT 1", key).first
|
95
|
+
row = @db.fetch("SELECT timeout, data, created_at, resource, max_running FROM `#{@table}` WHERE id=? LIMIT 1", key).first
|
96
96
|
unless row
|
97
97
|
raise NotFoundError, "task key=#{key} does no exist"
|
98
98
|
end
|
@@ -112,7 +112,7 @@ SQL
|
|
112
112
|
|
113
113
|
connect {
|
114
114
|
#@db.fetch("SELECT id, timeout, data, created_at, resource FROM `#{@table}` WHERE !(created_at IS NULL AND timeout <= ?) ORDER BY timeout ASC;", now) {|row|
|
115
|
-
@db.fetch("SELECT id, timeout, data, created_at, resource FROM `#{@table}` ORDER BY timeout ASC;", now) {|row|
|
115
|
+
@db.fetch("SELECT id, timeout, data, created_at, resource, max_running FROM `#{@table}` ORDER BY timeout ASC;", now) {|row|
|
116
116
|
attributes = create_attributes(now, row)
|
117
117
|
task = TaskWithMetadata.new(@client, row[:id], attributes)
|
118
118
|
yield task
|
@@ -304,6 +304,7 @@ SQL
|
|
304
304
|
:type => type,
|
305
305
|
:user => row[:resource],
|
306
306
|
:timeout => row[:timeout],
|
307
|
+
:max_running => row[:max_running],
|
307
308
|
:message => nil, # not supported
|
308
309
|
:node => nil, # not supported
|
309
310
|
}
|
data/lib/perfectqueue/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: perfectqueue
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.10
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-08-
|
12
|
+
date: 2012-08-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sequel
|