rails_runner 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7fe6d85e7c06db4cc3bbcb423aeb8c1648141f72
4
- data.tar.gz: a34cc5a4faa0cf463116520178c39dcf42b098c0
3
+ metadata.gz: 76dbf8208f0b0f8dd118ebe01a61309feadf90aa
4
+ data.tar.gz: 9e3099762d90fb462f236fd36bccc3791556720c
5
5
  SHA512:
6
- metadata.gz: dbbaf49f496fc5b8f35ecf36f5af2a5917194422f3b5cea1d5c00065f192171b647cd7d3be17e69300034a4fd6d60bb84d67f21f83d9cac440f5bf251faf5cae
7
- data.tar.gz: ff5fd166586a9c6236fab17527e667c002cc8b35625372ca7a33615f1e18c1aeb19cca18ecca51afb5b24dba2cca7bcfd0554d19b70c89c2369f00c3b22be6c3
6
+ metadata.gz: 09b4ed1935d173a098fb10ba3ae23ca31a6f7e90266031f8b86535ca596bd9c430a3072c7dd24de17bd16c7fb14c09363b75e3b736c394af9a31ff38fec8bc99
7
+ data.tar.gz: 5ea8d27c496c4feaf169c2c0f107df06018e1e47b23e3eaf92ede64d0b7c69416cdac50985c8d85be500453e14e203f337df37118527573ed42d2fe981b3d30a
@@ -43,6 +43,10 @@ module RailsRunner
43
43
  @configuration[:active] ||= !%w(test development).include?(env)
44
44
  end
45
45
 
46
+ def rate
47
+ (@configuration[:rate] ||= 60).seconds
48
+ end
49
+
46
50
  def hostname
47
51
  @hostname ||= Socket.gethostname
48
52
  end
@@ -1,3 +1,3 @@
1
1
  module RailsRunner
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -1,7 +1,6 @@
1
1
  module RailsRunner
2
2
  class Worker
3
3
  MUTEX = Mutex.new
4
- FLUSH_PERIOD = 10.seconds
5
4
  MAX_MULTIPLIER = 5
6
5
 
7
6
  attr_accessor :requests
@@ -19,6 +18,7 @@ module RailsRunner
19
18
  def initialize
20
19
  @queue = Queue.new
21
20
  @multiplier = 1
21
+ @flush_rate = RailsRunner.config.rate
22
22
  reset
23
23
  end
24
24
 
@@ -63,7 +63,7 @@ module RailsRunner
63
63
  def start_flusher
64
64
  Thread.new do
65
65
  loop do
66
- sleep @multiplier * FLUSH_PERIOD
66
+ sleep @multiplier * @flush_rate
67
67
  push(:flush)
68
68
  end
69
69
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_runner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benoist Claassen