garbageman 0.3.5 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZDIzZmI4OTVlOTVhZTA2Y2M4ZTQwZTRhYWFlMjAzYjc2MmU5YjE3MA==
4
+ ZTUxY2YyM2I2ODhiMjVhYTA0Y2JlZjUzNGIzMDc4NjJjNDc4MzdiOQ==
5
5
  data.tar.gz: !binary |-
6
- YTRjM2E2ZTE4NDg2N2E0NDg4YzVlYjE5ZTY0OTE5MzkzM2VhNzc4NQ==
6
+ YjI0NmU3NmFjZjcyMDdiNTJkNWQxOWJmYjQxNjk0OWRhZjhmZDk0MQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZDU5NjY5MjE4YmQ4NDkyZGU4NjM4ZmVmMzY4NGRhMGFmOWVmYmQzNGEyZTJl
10
- Y2Y3MTcxNTc4MzIyYzlmYzE5NTdkZDJkNDIyOWVmZjE3MGVmZTc3YmYyY2M3
11
- MjVkOGZlZjY0OGU5YjMwYjBlMjRjODJiMmIzMjdhZDcwMjdlOTk=
9
+ MWJlYjQ5Yjc2OWEzMjM4YTNmZTk0ODAzNmZiZTg4YzVkN2M5OGYyZDczOGM5
10
+ OWU0YjNiMTRjMTY2NzI2N2E0ZDFjNjQ1NmEwNzk3MjNmZjEzY2I3YWZjNTk0
11
+ ODY3Y2FiNjUwNmMyYzA5OGIwMjIxM2QxZTgzN2JjZTAwN2RjNzE=
12
12
  data.tar.gz: !binary |-
13
- ZThhNjUyMTViMmM5NmEzMWY4MTNjZTRjYTFiYjhhMTVlYTllNzNjMzk4OTRj
14
- NTYxZTEyMjQ3NTBhMzBjN2FhMDlkNTdhM2FjNDY5ZDQ4ZTZiZjE3MjFlMGM3
15
- YjNmNDQxODJmYTE1OTY3MGYwN2Q4NTAxOThmM2UxNWNhY2M5NjM=
13
+ NjYzOWYzMjNiZjVlZDFlOGMwMDRlYWUwYjU4ODRhZTc5YTBhMThjZjgzYTU2
14
+ ZjUzYzkxOTUwZmRkNDA2MTRiMjdiNWJhZDNmZWFjZjY3NDk1NWU4NjNlMzk4
15
+ ZDE3NWUyN2UyMWI4NDYzZDM5N2E5MDcwODA4NDk4MTRkZmFiZWE=
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.5
1
+ 0.3.6
data/garbageman.gemspec CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "garbageman"
9
- s.version = "0.3.5"
9
+ s.version = "0.3.6"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
@@ -78,6 +78,8 @@ module GarbageMan
78
78
  end
79
79
 
80
80
  unless can_collect?
81
+ @can_collect_at ||= Time.now
82
+ return unless (Time.now - @can_collect_at) >= Config.time_to_wait_before_collecting
81
83
  return unless will_collect # return unless been selected to gc
82
84
  if waited_too_long_for_connections_to_drain?
83
85
  warn CONNECTIONS_DID_NOT_DRAIN_IN_TIME
@@ -202,6 +204,7 @@ module GarbageMan
202
204
  @will_collect = false
203
205
  @will_select_next_server = false
204
206
  @selected_to_collect_at = nil
207
+ @can_collect_at = nil
205
208
  end
206
209
 
207
210
  def busy?
@@ -64,5 +64,11 @@ module GarbageMan
64
64
  @@gc_sleep = 0.00
65
65
  def self.gc_sleep; @@gc_sleep; end
66
66
  def self.gc_sleep=(v); @@gc_sleep = v || 10; end
67
+
68
+ # after selected and connections are drained, wait this many seconds before
69
+ # collecting so that all proxies are aware that this process will collect
70
+ @@time_to_wait_before_collecting = 2.0
71
+ def self.time_to_wait_before_collecting; @@time_to_wait_before_collecting; end
72
+ def self.time_to_wait_before_collecting=(v); @@time_to_wait_before_collecting = v || 2.0; end
67
73
  end
68
74
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: garbageman
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Doug Youch
@@ -101,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
101
101
  version: '0'
102
102
  requirements: []
103
103
  rubyforge_project:
104
- rubygems_version: 2.4.8
104
+ rubygems_version: 2.6.13
105
105
  signing_key:
106
106
  specification_version: 4
107
107
  summary: Process requests without garbage collection