navvy-sequelhooks 0.3.6 → 0.3.7
Sign up to get free protection for your applications and to get access to all the features.
@@ -63,9 +63,9 @@ module Navvy
|
|
63
63
|
|
64
64
|
def run
|
65
65
|
begin
|
66
|
-
started
|
66
|
+
self.started
|
67
67
|
result = constantize(object).send(method_name, *args).inspect
|
68
|
-
Navvy::Job.keep? ? completed(result) : destroy
|
68
|
+
Navvy::Job.keep? ? self.completed(result) : self.destroy
|
69
69
|
result
|
70
70
|
rescue Exception => exception
|
71
71
|
failed(exception.message)
|
@@ -47,7 +47,6 @@ module Navvy
|
|
47
47
|
# jobs were found.
|
48
48
|
|
49
49
|
def self.next(limit = self.limit)
|
50
|
-
self.
|
51
50
|
filter(:failed_at => nil).
|
52
51
|
filter(:completed_at => nil).
|
53
52
|
filter{run_at <= Time.now}.
|
@@ -65,9 +64,9 @@ module Navvy
|
|
65
64
|
def self.cleanup
|
66
65
|
if keep.is_a? Fixnum
|
67
66
|
time = Time.now - keep
|
68
|
-
|
67
|
+
Navvy::Job.filter{completed_at <= time}.destroy
|
69
68
|
else
|
70
|
-
|
69
|
+
Navvy::Job.filter(~{:completed_at => nil}).destroy unless keep?
|
71
70
|
end
|
72
71
|
end
|
73
72
|
|