bluth 0.6.7 → 0.6.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,11 @@
1
1
  BLUTH, CHANGES
2
2
 
3
+ #### 0.6.8 (2011-02-07) ###############################
4
+
5
+ * FIXED: Remove use of calls to fineround in Worker
6
+ * CHANGE: Only call Familia.ld when in debug mode.
7
+
8
+
3
9
  #### 0.6.7 (2011-01-08) ###############################
4
10
 
5
11
  * FIXED: -f option now works for stop-workers and stop-scheduler commands
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :MAJOR: 0
3
3
  :MINOR: 6
4
- :PATCH: 7
4
+ :PATCH: 8
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{bluth}
8
- s.version = "0.6.7"
8
+ s.version = "0.6.8"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Delano Mandelbaum"]
12
- s.date = %q{2011-01-08}
12
+ s.date = %q{2011-02-08}
13
13
  s.default_executable = %q{bluth}
14
14
  s.description = %q{A Redis queuing system built on top of Familia}
15
15
  s.email = %q{delano@solutious.com}
@@ -140,7 +140,7 @@ module Bluth
140
140
  order << Bluth.queuetimeout # We do it this way to support Ruby 1.8
141
141
  queue, gobid = *(Bluth::Queue.redis.send(meth, *order) || [])
142
142
  unless queue.nil?
143
- Familia.ld "FOUND #{gobid} id #{queue}"
143
+ Familia.ld "FOUND #{gobid} id #{queue}" if Familia.debug?
144
144
  gob = Gob.from_redis gobid
145
145
  raise Bluth::Buster, "No such gob object: #{gobid}" if gob.nil?
146
146
  Bluth::Queue.running << gob.jobid
@@ -154,7 +154,7 @@ module Bluth
154
154
  Familia.info "ERROR (#{ex.message}): #{gobid} is an orphan"
155
155
  Bluth::Queue.orphaned << gobid
156
156
  end
157
- Familia.ld ex.backtrace
157
+ Familia.ld ex.backtrace if Familia.debug?
158
158
  end
159
159
  gob
160
160
  end
@@ -186,7 +186,7 @@ module Bluth
186
186
  gob.created
187
187
  gob.attempts = 0
188
188
  gob.save
189
- Familia.ld "ENQUEUING: #{self} #{gob.jobid.short} to #{q}"
189
+ Familia.ld "ENQUEUING: #{self} #{gob.jobid.short} to #{q}" if Familia.debug?
190
190
  q << gob.jobid
191
191
  gob
192
192
  end
@@ -257,7 +257,7 @@ module Bluth
257
257
  end
258
258
  def perform
259
259
  @attempts += 1
260
- Familia.ld "PERFORM: #{self.to_hash.inspect}"
260
+ Familia.ld "PERFORM: #{self.to_hash.inspect}" if Familia.debug?
261
261
  @stime = Time.now.utc.to_f
262
262
  save # update the time
263
263
  self.handler.prepare if self.class.respond_to?(:prepare)
@@ -291,7 +291,7 @@ module Bluth
291
291
  Bluth.queue(current_queue)
292
292
  end
293
293
  def dequeue!
294
- Familia.ld "Deleting #{self.jobid} from #{queue.rediskey}"
294
+ Familia.ld "Deleting #{self.jobid} from #{queue.rediskey}" if Familia.debug?
295
295
  queue.remove 0, self.jobid
296
296
  end
297
297
  def running!
@@ -303,7 +303,7 @@ module Bluth
303
303
  # raise Bluth::Buster, "Cannot move job to the queue it's in: #{to}"
304
304
  #end
305
305
  from, to = Bluth.queue(current_queue), Bluth.queue(to)
306
- Familia.ld "Moving #{self.jobid} from #{from.rediskey} to #{to.rediskey}"
306
+ Familia.ld "Moving #{self.jobid} from #{from.rediskey} to #{to.rediskey}" if Familia.debug?
307
307
  @messages << msg unless msg.nil? || msg.empty?
308
308
  # We push first to make sure we never lose a Gob ID. Instead
309
309
  # there's the small chance of a job ID being in two queues.
@@ -171,7 +171,7 @@ module Bluth
171
171
  Familia.reconnect_all! # Need to reconnect after daemonize
172
172
  save
173
173
  scheduler.every Worker.interval, :blocking => true do |task|
174
- Familia.ld "#{$$} TICK @ #{Time.now.utc}"
174
+ Familia.ld "#{$$} TICK @ #{Time.now.utc}" if Familia.debug?
175
175
  sleep rand
176
176
  find_gob task
177
177
  end
@@ -217,7 +217,7 @@ module Bluth
217
217
  tms = Benchmark.measure do
218
218
  job.perform
219
219
  end
220
- job.cpu = [tms.utime.fineround(3),tms.stime.fineround(3),tms.real.fineround(3)]
220
+ job.cpu = [tms.utime,tms.stime,tms.real]
221
221
  job.save
222
222
  job.success!
223
223
  self.success!
@@ -303,7 +303,7 @@ module Bluth
303
303
  ScheduleWorker.schedule = Rufus::Scheduler::EmScheduler.start_new
304
304
  self.class.every.each do |args|
305
305
  interval, opts, blk = *args
306
- Familia.ld " scheduling every #{interval}: #{opts}"
306
+ Familia.ld " scheduling every #{interval}: #{opts}" if Familia.debug?
307
307
  ScheduleWorker.schedule.every interval, opts, &blk
308
308
  end
309
309
  }
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bluth
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 6
9
- - 7
10
- version: 0.6.7
9
+ - 8
10
+ version: 0.6.8
11
11
  platform: ruby
12
12
  authors:
13
13
  - Delano Mandelbaum
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-01-08 00:00:00 -05:00
18
+ date: 2011-02-08 00:00:00 -05:00
19
19
  default_executable: bluth
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency