navvy-sequelhooks 0.3.5 → 0.3.6
Sign up to get free protection for your applications and to get access to all the features.
@@ -47,7 +47,8 @@ module Navvy
|
|
47
47
|
# jobs were found.
|
48
48
|
|
49
49
|
def self.next(limit = self.limit)
|
50
|
-
|
50
|
+
self.
|
51
|
+
filter(:failed_at => nil).
|
51
52
|
filter(:completed_at => nil).
|
52
53
|
filter{run_at <= Time.now}.
|
53
54
|
order(:priority.desc, :created_at).
|
@@ -64,9 +65,9 @@ module Navvy
|
|
64
65
|
def self.cleanup
|
65
66
|
if keep.is_a? Fixnum
|
66
67
|
time = Time.now - keep
|
67
|
-
filter{completed_at <= time}.destroy
|
68
|
+
self.filter{completed_at <= time}.destroy
|
68
69
|
else
|
69
|
-
filter(~{:completed_at => nil}).destroy unless keep?
|
70
|
+
self.filter(~{:completed_at => nil}).destroy unless keep?
|
70
71
|
end
|
71
72
|
end
|
72
73
|
|
@@ -86,7 +87,7 @@ module Navvy
|
|
86
87
|
# update_attributes call
|
87
88
|
|
88
89
|
def started
|
89
|
-
update(:started_at => Time.now)
|
90
|
+
self.update(:started_at => Time.now)
|
90
91
|
end
|
91
92
|
|
92
93
|
##
|
@@ -99,7 +100,7 @@ module Navvy
|
|
99
100
|
# update_attributes call
|
100
101
|
|
101
102
|
def completed(return_value = nil)
|
102
|
-
update(
|
103
|
+
self.update(
|
103
104
|
:completed_at => Time.now,
|
104
105
|
:return => return_value
|
105
106
|
)
|
@@ -117,7 +118,7 @@ module Navvy
|
|
117
118
|
|
118
119
|
def failed(message = nil)
|
119
120
|
self.retry unless times_failed >= self.class.max_attempts
|
120
|
-
update(
|
121
|
+
self.update(
|
121
122
|
:failed_at => Time.now,
|
122
123
|
:exception => message
|
123
124
|
)
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: navvy-sequelhooks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.3.
|
5
|
+
version: 0.3.6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Jeff Kreeftmeijer
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2013-01-
|
13
|
+
date: 2013-01-28 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rake
|