steve 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/steve.rb +3 -0
- data/lib/steve/interface/views/index.haml +3 -2
- data/lib/steve/queued_job.rb +6 -2
- metadata +2 -2
data/lib/steve.rb
CHANGED
@@ -28,6 +28,9 @@ module Steve
|
|
28
28
|
|
29
29
|
## Allow parent process name to be kept
|
30
30
|
attr_accessor :keep_parent_process_name
|
31
|
+
|
32
|
+
## Delete jobs after successful completion
|
33
|
+
attr_accessor :delete_successful_jobs
|
31
34
|
|
32
35
|
## Return the worker name for this current process/host
|
33
36
|
def worker_name
|
@@ -68,7 +68,8 @@
|
|
68
68
|
%li== #{Steve::QueuedJob.count} jobs stored
|
69
69
|
%li== #{Steve::QueuedJob.pending.count} pending execution
|
70
70
|
%li== #{Steve::QueuedJob.running.count} running now
|
71
|
-
|
72
|
-
%
|
71
|
+
- unless Steve.delete_successful_jobs
|
72
|
+
%li
|
73
|
+
%a{:href => 'jobs/completed'}== #{Steve::QueuedJob.completed.count} completed successfully
|
73
74
|
%li
|
74
75
|
%a{:href => 'jobs/failed'}== #{Steve::QueuedJob.failed.count} failed to execute
|
data/lib/steve/queued_job.rb
CHANGED
@@ -4,7 +4,7 @@ module Steve
|
|
4
4
|
class QueuedJob < ActiveRecord::Base
|
5
5
|
|
6
6
|
## Set the table name - a migration should be created for this
|
7
|
-
|
7
|
+
self.table_name = Steve.jobs_table_name || 'jobs'
|
8
8
|
|
9
9
|
## Serialize the options
|
10
10
|
serialize :params
|
@@ -121,7 +121,11 @@ module Steve
|
|
121
121
|
self.output = File.read(@output_file)
|
122
122
|
FileUtils.rm(@output_file)
|
123
123
|
end
|
124
|
-
self.
|
124
|
+
if self.status == 'completed' && Steve.delete_successful_jobs
|
125
|
+
self.destroy
|
126
|
+
else
|
127
|
+
self.save(:validate => false)
|
128
|
+
end
|
125
129
|
end
|
126
130
|
|
127
131
|
## Get a lock on this job. Returns true if the lock was successful
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: steve
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
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-
|
12
|
+
date: 2012-07-18 00:00:00.000000000Z
|
13
13
|
dependencies: []
|
14
14
|
description:
|
15
15
|
email: support@atechmedia.com
|