stalker 0.6.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README.md +4 -4
  2. data/VERSION +1 -1
  3. data/lib/stalker.rb +4 -4
  4. metadata +2 -2
data/README.md CHANGED
@@ -51,16 +51,16 @@ Stalker:
51
51
  Now run a worker using the stalk binary:
52
52
 
53
53
  $ stalk jobs.rb
54
- [Thu May 13 01:08:19 -0700 2010] Working 3 jobs: [ email.send post.cleanup.all post.cleanup ]
55
- [Thu May 13 01:08:21 -0700 2010] -> send.email (email=hello@example.com)
56
- [Thu May 13 01:08:21 -0700 2010] -> send.email finished in 31ms
54
+ Working 3 jobs: [ email.send post.cleanup.all post.cleanup ]
55
+ Working send.email (email=hello@example.com)
56
+ Finished send.email in 31ms
57
57
 
58
58
  Stalker will log to stdout as it starts working each job, and then again when the job finishes including the ellapsed time in milliseconds.
59
59
 
60
60
  Filter to a list of jobs you wish to run with an argument:
61
61
 
62
62
  $ stalk jobs.rb post.cleanup.all,post.cleanup
63
- [Sat Apr 17 14:13:40 -0700 2010] Working 2 jobs: [ post.cleanup.all post.cleanup ]
63
+ Working 2 jobs: [ post.cleanup.all post.cleanup ]
64
64
 
65
65
  In a production environment you may run one or more high-priority workers (limited to short/urgent jobs) and any number of regular workers (working all jobs). For example, two workers working just the email.send job, and four running all jobs:
66
66
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.0
1
+ 0.6.1
data/lib/stalker.rb CHANGED
@@ -105,18 +105,18 @@ module Stalker
105
105
  ''
106
106
  end
107
107
 
108
- log [ "->", name, args_flat ].join(' ')
108
+ log [ "Working", name, args_flat ].join(' ')
109
109
  @job_begun = Time.now
110
110
  end
111
111
 
112
- def log_job_end(name, type="finished")
112
+ def log_job_end(name, failed=false)
113
113
  ellapsed = Time.now - @job_begun
114
114
  ms = (ellapsed.to_f * 1000).to_i
115
- log "-> #{name} #{type} in #{ms}ms"
115
+ log "Finished #{name} in #{ms}ms #{failed ? ' (failed)' : ''}"
116
116
  end
117
117
 
118
118
  def log(msg)
119
- puts "[#{Time.now}] #{msg}"
119
+ puts msg
120
120
  end
121
121
 
122
122
  def log_error(msg)
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 6
8
- - 0
9
- version: 0.6.0
8
+ - 1
9
+ version: 0.6.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Adam Wiggins