slowpoke 0.1.1 → 0.1.2

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: c5f0a6122b30b1ab9e451cb58a294368a13e9925
4
- data.tar.gz: 9970da3afc5dab294ebdd817c6b412faebbc6577
3
+ metadata.gz: 7218b133076d867f936b395fe4a2c87166b6e227
4
+ data.tar.gz: 54be0d4d6b54765a6df112d6fbfce7bbc25e96f0
5
5
  SHA512:
6
- metadata.gz: bcd4a2ff4292b535615947f440cbef41037a0aaa4e61d9f8d478158875172f76c79dff4f4bbba3751cba7c1e674918e150053520aab52864fc45ece66a6bcb44
7
- data.tar.gz: cf6a6cf5030ce46c9a45dd661472865fd6af88844027ad2ab38c35e8988ad4fca4fd9d797e4bb545684a204cdd14782447b363748cc09b9c43e194485205b9a6
6
+ metadata.gz: 9e6ca9a708e66b232143d42416a18eff3579d0e939e4f90f944d0eede0fc4312a6c6118d7c0f3cd55818e14e376c861fa70cba3e0413387b91934ffba7d3fdba
7
+ data.tar.gz: aa743cb1419b9ed96d3a902f8ba5c26a205dfb201e976f4241a6d7ca32254bb82ffb8889260812a92e0a984f95874dbf83cfe07b8002f232c5335e6f0f7a6a38
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.1.2
2
+
3
+ - Updated to latest version of rack-timeout, removing the need to bubble timeouts
4
+
1
5
  ## 0.1.1
2
6
 
3
7
  - Fixed safer service timeouts
@@ -5,7 +5,8 @@ module Slowpoke
5
5
  end
6
6
 
7
7
  def call(env)
8
- response = @app.call(env)
8
+ @app.call(env)
9
+ ensure
9
10
  if env[Slowpoke::ENV_KEY]
10
11
  # extremely important
11
12
  # protect the process with a restart
@@ -17,7 +18,6 @@ module Slowpoke
17
18
  Process.kill("QUIT", Process.pid)
18
19
  end
19
20
  end
20
- response
21
21
  end
22
22
  end
23
23
  end
@@ -3,9 +3,9 @@ module Slowpoke
3
3
  initializer "slowpoke" do |app|
4
4
  Rack::Timeout.timeout = Slowpoke.timeout
5
5
 
6
- # prevent RequestExpiryError from killing web server
7
- app.config.middleware.delete "Rack::Timeout"
8
6
  app.config.middleware.insert_before "ActionDispatch::RemoteIp", "Rack::Timeout"
7
+
8
+ # prevent RequestExpiryError from killing web server
9
9
  app.config.middleware.insert 0, Slowpoke::Middleware
10
10
  end
11
11
  end
@@ -1,3 +1,3 @@
1
1
  module Slowpoke
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
data/lib/slowpoke.rb CHANGED
@@ -1,7 +1,6 @@
1
1
  require "slowpoke/version"
2
- require "rack-timeout"
2
+ require "rack/timeout/base"
3
3
  require "safely_block"
4
- require "slowpoke/controller"
5
4
  require "slowpoke/middleware"
6
5
  require "slowpoke/migration"
7
6
  require "slowpoke/railtie"
@@ -37,6 +36,3 @@ Rack::Timeout.register_state_change_observer(:slowpoke) do |env|
37
36
  ActiveSupport::Notifications.instrument("timeout.slowpoke", {})
38
37
  end
39
38
  end
40
-
41
- # bubble exceptions for error reporting libraries
42
- ActionController::Base.send(:include, Slowpoke::Controller)
data/slowpoke.gemspec CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ["lib"]
20
20
 
21
21
  spec.add_dependency "rails"
22
- spec.add_dependency "rack-timeout", ">= 0.1.0"
22
+ spec.add_dependency "rack-timeout", ">= 0.3.0"
23
23
  spec.add_dependency "safely_block"
24
24
 
25
25
  spec.add_development_dependency "bundler", "~> 1.7"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slowpoke
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-03 00:00:00.000000000 Z
11
+ date: 2016-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 0.1.0
33
+ version: 0.3.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 0.1.0
40
+ version: 0.3.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: safely_block
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -96,7 +96,6 @@ files:
96
96
  - lib/generators/slowpoke/install_generator.rb
97
97
  - lib/generators/slowpoke/templates/503.html
98
98
  - lib/slowpoke.rb
99
- - lib/slowpoke/controller.rb
100
99
  - lib/slowpoke/middleware.rb
101
100
  - lib/slowpoke/migration.rb
102
101
  - lib/slowpoke/railtie.rb
@@ -122,9 +121,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
122
121
  version: '0'
123
122
  requirements: []
124
123
  rubyforge_project:
125
- rubygems_version: 2.4.5
124
+ rubygems_version: 2.4.5.1
126
125
  signing_key:
127
126
  specification_version: 4
128
127
  summary: Rack::Timeout is great. Slowpoke makes it better.
129
128
  test_files: []
130
- has_rdoc:
@@ -1,21 +0,0 @@
1
- module Slowpoke
2
- module Controller
3
- extend ActiveSupport::Concern
4
-
5
- included do
6
- around_filter :bubble_timeout
7
- end
8
-
9
- private
10
-
11
- def bubble_timeout
12
- yield
13
- rescue => exception
14
- if exception.respond_to?(:original_exception) && exception.original_exception.is_a?(Rack::Timeout::Error)
15
- raise exception.original_exception
16
- else
17
- raise exception
18
- end
19
- end
20
- end
21
- end