Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Bug in rate computation from environment fixed.

  • Loading branch information...
commit cea3d1c26fdfbe41d9a96a797411a6637b258b28 1 parent 1ccad48
benzenwen authored March 18, 2012

Showing 1 changed file with 4 additions and 2 deletions. Show diff stats Hide diff stats

  1. 6  writer.rb
6  writer.rb
@@ -39,7 +39,8 @@
39 39
 
40 40
 uristring = ENV['MONGOLAB_URI'] || 'mongodb://localhost/testdatabase'
41 41
 debug = ENV['WRITER_DEBUG'] || "false"
42  
-rate = ENV['WRITER_RATE'].to_f || 10.0
  42
+rate = ENV['WRITER_RATE'].to_f 
  43
+if (rate = 0.0) then rate = 10.0
43 44
 
44 45
 
45 46
 uri = URI.parse(uristring)
@@ -61,7 +62,8 @@
61 62
   doc['ordinal'] = i
62 63
   coll.insert(doc, :safe => true)
63 64
   if (debug == "true") then pp (doc) end
64  
-  sleep(1.0/rate)
  65
+  sleep(1.0/rate) 
  66
+  print rate
65 67
 end
66 68
 
67 69
 print("Finished. Inserted ", count, " messages.\n")

0 notes on commit cea3d1c

Please sign in to comment.
Something went wrong with that request. Please try again.