jets 0.8.1 → 0.8.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
  SHA256:
3
- metadata.gz: eebd400edfb6c76668917aa7cd01d921e4fe986b19e233aa10a688bd0ea9fe5f
4
- data.tar.gz: 17d59f6694b0215e090c34ca250414570888bfef424403c51cfbe580a6487eb3
3
+ metadata.gz: 40360dae957d26be5d95365570b65af5b0d865ce8940078c8acbf136ecf4e4fd
4
+ data.tar.gz: f976b075cf144abfb50385aa57bc0413b1851b4c7e58a346705f83281d93fd77
5
5
  SHA512:
6
- metadata.gz: caa1419678318a8cfdb27e973ff0a9ee5555ccd4524b38022b29d33cc77cef0a99920ad511c71b9dd6ac72084563bea93205ea4892333ec67d1210da0a96941c
7
- data.tar.gz: f7c4a9f5ad1e2cb694a83a82a95a468377dbcb97736f015e6320c4198db31ccecc966a6381412c020710da87b34759a0f8a1c5052d479c87f2fab4063d593cc9
6
+ metadata.gz: 2d34841937dc1d52101b0079f953e40dad6297b27c56472e7d9e778639774be975ea704d28b025913491b2d419c5e80ef612950d6505d2c71d48d19781d403ed
7
+ data.tar.gz: b66e879020076d307c1bfb30d2937dc83b56ec94a82fce89e3f63011494da0987baa994d8456ca178ae226f57c2576b26f1104b8bb93d465b02a416068e282f4
data/CHANGELOG.md CHANGED
@@ -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/), even before v1.0.
5
5
 
6
+ ## [0.8.2]
7
+ - add prewarm.public_ratio option: http://rubyonjets.com/docs/prewarming/
8
+
6
9
  ## [0.8.1]
7
10
  - Upgrade all cfn resources to use the core jets resource model: request #21 from tongueroo/core-resource2
8
11
  - Rid of mimimal-stack.yml and use jets core resource model
data/Gemfile.lock CHANGED
@@ -11,7 +11,7 @@ GIT
11
11
  PATH
12
12
  remote: .
13
13
  specs:
14
- jets (0.8.1)
14
+ jets (0.8.2)
15
15
  actionpack (>= 5.2.1)
16
16
  actionview (>= 5.2.1)
17
17
  activerecord (>= 5.2.1)
@@ -21,8 +21,9 @@ class Jets::Application
21
21
 
22
22
  config.prewarm = ActiveSupport::OrderedOptions.new
23
23
  config.prewarm.enable = true
24
+ config.prewarm.rate = '2 hours'
24
25
  config.prewarm.concurrency = 2
25
- config.prewarm.rate = '30 minutes'
26
+ config.prewarm.public_ratio = 5
26
27
 
27
28
  config.lambdagems = ActiveSupport::OrderedOptions.new
28
29
  config.lambdagems.sources = [
@@ -68,8 +68,8 @@ class Jets::Commands::Call
68
68
  begin
69
69
  resp = lambda.invoke(options)
70
70
  rescue Aws::Lambda::Errors::ResourceNotFoundException
71
- puts "The function #{function_name} was not found. Maybe check the spelling?".colorize(:red)
72
- exit
71
+ puts "The function #{function_name} was not found. Maybe check the spelling or the AWS_PROFILE?".colorize(:red)
72
+ return
73
73
  end
74
74
 
75
75
  if @options[:show_log]
@@ -1,8 +1,12 @@
1
1
  Jets.application.configure do
2
2
  config.project_name = "<%= project_name %>"
3
3
  config.api_generator = <%= !!@options[:api] %>
4
- # config.prewarm.rate = '30 minutes' # default is '30 minutes'
5
- # config.prewarm.concurrency = 1 # default is 1
4
+
5
+ # config.prewarm.enable = true # default is true
6
+ # config.prewarm.rate = '2 hours' # default is '2 hours'
7
+ # config.prewarm.concurrency = 2 # default is 2
8
+ # config.prewarm.public_ratio = 5 # default is 5
9
+
6
10
  # config.env_extra = 2 # can also set this with JETS_ENV_EXTRA
7
11
  # config.extra_autoload_paths = []
8
12
 
data/lib/jets/preheat.rb CHANGED
@@ -34,11 +34,33 @@ module Jets
34
34
  end
35
35
  end
36
36
  threads.each { |t| t.join }
37
+
38
+ # Warm the jets-public_controller more since it gets called more naturally
39
+ warm_public_controller_more
40
+
37
41
  # return the funciton names so we can see in the Lambda console
38
42
  # the functions being prewarmed
39
43
  all_functions
40
44
  end
41
45
 
46
+ def warm_public_controller_more
47
+ function_name = 'jets-public_controller-show' # key function name
48
+ return unless all_functions.include?(function_name)
49
+
50
+ public_ratio = Jets.config.prewarm.public_ratio
51
+ return if public_ratio == 0
52
+
53
+ puts "Prewarming the public controller extra at a ratio of #{public_ratio}" unless @options[:mute]
54
+
55
+ threads = []
56
+ public_ratio.times do
57
+ threads << Thread.new do
58
+ warm(function_name)
59
+ end
60
+ end
61
+ threads.each { |t| t.join }
62
+ end
63
+
42
64
  # Returns:
43
65
  # [
44
66
  # "posts_controller-index",
data/lib/jets/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Jets
2
- VERSION = "0.8.1"
2
+ VERSION = "0.8.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen