navvy 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/navvy/job/active_record.rb +5 -5
- metadata +3 -3
@@ -43,8 +43,8 @@ module Navvy
|
|
43
43
|
|
44
44
|
def self.next(limit = self.limit)
|
45
45
|
all(
|
46
|
-
:conditions =>
|
47
|
-
'
|
46
|
+
:conditions => [
|
47
|
+
"#{connection.quote_column_name('failed_at')} IS NULL AND #{connection.quote_column_name('completed_at')} IS NULL AND #{connection.quote_column_name('run_at')} <= ?",
|
48
48
|
Time.now
|
49
49
|
],
|
50
50
|
:limit => limit,
|
@@ -62,12 +62,12 @@ module Navvy
|
|
62
62
|
def self.cleanup
|
63
63
|
if keep.is_a? Fixnum
|
64
64
|
delete_all([
|
65
|
-
'
|
65
|
+
"#{connection.quote_column_name('completed_at')} <= ?",
|
66
66
|
keep.ago
|
67
67
|
])
|
68
68
|
else
|
69
69
|
delete_all(
|
70
|
-
'
|
70
|
+
"#{connection.quote_column_name('completed_at')} IS NOT NULL"
|
71
71
|
) unless keep?
|
72
72
|
end
|
73
73
|
end
|
@@ -127,7 +127,7 @@ module Navvy
|
|
127
127
|
def times_failed
|
128
128
|
i = parent_id || id
|
129
129
|
self.class.count(
|
130
|
-
:conditions => "(
|
130
|
+
:conditions => "(#{connection.quote_column_name('id')} = '#{i}' OR #{connection.quote_column_name('parent_id')} = '#{i}') AND #{connection.quote_column_name('failed_at')} IS NOT NULL"
|
131
131
|
)
|
132
132
|
end
|
133
133
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 3
|
8
|
-
-
|
9
|
-
version: 0.3.
|
8
|
+
- 1
|
9
|
+
version: 0.3.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Jeff Kreeftmeijer
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-
|
17
|
+
date: 2010-07-09 00:00:00 +02:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|