steve 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -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
- %li
72
- %a{:href => 'jobs/completed'}== #{Steve::QueuedJob.completed.count} completed successfully
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
@@ -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
- set_table_name(Steve.jobs_table_name || 'jobs')
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.save(:validate => false)
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.3
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-04-26 00:00:00.000000000Z
12
+ date: 2012-07-18 00:00:00.000000000Z
13
13
  dependencies: []
14
14
  description:
15
15
  email: support@atechmedia.com