jets 2.0.0 → 2.0.1

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
  SHA256:
3
- metadata.gz: 90b750940941cb6ebaa69fc6a0cda74dc858db9f646a2c90b5a90e1b037518d8
4
- data.tar.gz: b591655943debcf36b60618e11745d172658dd3fe7415a9ab46c6e4e2adf4c27
3
+ metadata.gz: 595189c68ebf3b306738227bb516e6ab44f93c9be22a67c4ae9028129384c553
4
+ data.tar.gz: b1ff731c9dff57744f63de0de36d62a177267b21236814eab97ce516bacac19c
5
5
  SHA512:
6
- metadata.gz: 694c37c3c6331c565441ae486643969bdebc914ec193ca8fdec5d36fb928915aee9ede4c8fbe689b06fef1a52f6bd8072188b4796c247e16e9b9bb810163dfbb
7
- data.tar.gz: b28b1b16569a58d06e647a3d05ac8ecdb9d0ba7e615870d82273d6911da31386ae7c86593a97ee41933ed6aa592eae3b92b407ad5b8cb5d2a11fa0f3c98fd0fd
6
+ metadata.gz: 931fce86443f6cd48e7b481572bc739ae354cb7015f26229c8b80eb3bb8fabd65d6a12b5488fc57739ccaa7bf62426c7619cd2d60c2a42cbfaba2690ca2506de
7
+ data.tar.gz: a75e02410737e0c5aa77a22721462c2dcb784c048873f91f5d51dc3db3b3883d2af716bd79ebe8918f31717b5b46d606f54128bacee1fa5c259686e2cf21ba5b
@@ -3,6 +3,9 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  This project *loosely tries* to adhere to [Semantic Versioning](http://semver.org/).
5
5
 
6
+ ## [2.0.1]
7
+ - #319 improve mega mode or afterburner, start back up rack process if it dies for any reason
8
+
6
9
  ## [2.0.0]
7
10
  - #318 Major Routing upgrade
8
11
  - Routing Upgrades: nested resources, namespace, scope, singular resource
@@ -43,7 +43,7 @@ module Jets::Mega
43
43
  request = set_headers!(request)
44
44
 
45
45
  # Make request
46
- response = http.request(request)
46
+ response = send_request(http, request)
47
47
 
48
48
  puts_rack_output
49
49
 
@@ -58,6 +58,30 @@ module Jets::Mega
58
58
  }
59
59
  end
60
60
 
61
+ # Adds error handling in case the rack server has gone down. Will try to start the server back up if needed.
62
+ # Search CloudWatch logs for 'Unable to send request' to find for indication of this.
63
+ def send_request(http, request)
64
+ retries = 0
65
+ max_retries = 30 # 15 seconds at a delay of 0.5s
66
+ delay = 0.5
67
+
68
+ begin
69
+ http.request(request) # response
70
+ rescue Errno::ECONNREFUSED, Errno::EAFNOSUPPORT
71
+ puts "Unable to send request to localhost:9292. Will try to start the server with a delay of #{delay} and try again."
72
+ Jets.start_rack_server
73
+
74
+ sleep(delay)
75
+ retries += 1
76
+ if retries < max_retries
77
+ retry
78
+ else
79
+ puts "Giving up on trying to send request to localhost:9292"
80
+ raise # re-raise error
81
+ end
82
+ end
83
+ end
84
+
61
85
  def get_encoding(content_type)
62
86
  default = Jets.config.encoding.default
63
87
  return default unless content_type
@@ -1,3 +1,3 @@
1
1
  module Jets
2
- VERSION = "2.0.0"
2
+ VERSION = "2.0.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jets
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-07-27 00:00:00.000000000 Z
11
+ date: 2019-07-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionmailer