lambda_punch 0.0.5 → 0.0.6

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: 9b529ffff90a0b50ed952e847aaefd4f8346de8ed704f49b4af84d08d6d799c8
4
- data.tar.gz: fff2431cc2da50f8a353ebc1d6969d8f48ddb50544cff3efcdf6f5f9b0372c75
3
+ metadata.gz: acb3627a0b668ca042411a2458ac2f203964b9c4e7989261d089c3f26daa7034
4
+ data.tar.gz: 4b5a88989a40d9596473e603b0ffbf00d702bc550b6c0f330a380632d036fcac
5
5
  SHA512:
6
- metadata.gz: 23e7aedbcf946a8416ece631afc50e5c5bc2c6b55afd0fdbed9a1446f55e16b1efd15ac7acc73642e232c353a5697753bfa42d011576c9d86e7560bc63b96b4e
7
- data.tar.gz: a51c43ea79d97f8c7e890f733e4bb34e9a20a7d60a7868477c6f3bc016b4d82f83c085754587761e37882e832b25159f43559851af91242a6cf4974b2e144d24
6
+ metadata.gz: 1ea4db3eb1b7ff42b5158d110e9cd4147945794a2e4e976826c3697230a38d6ef4ce640d436928f07e78bd3f396f0ccbc2256765eb22f51d66b24a764e7b3190
7
+ data.tar.gz: 30274ee2debd3d74f9e486934120c78669e38ec1a1761254fb0281fdaf412a2440ea8f51aed6bc8317aa51c7ece88774d4b6d8495c2791e3ff7cd186bfdaba2d
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## [0.0.6] - 2021-06-28
2
+
3
+ - Ensure Queue is always callable.
4
+ - Change default log level to `error`.
5
+
1
6
  ## [0.0.5] - 2021-06-28
2
7
 
3
8
  - Ensure Queue is always present.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lambda_punch (0.0.5)
4
+ lambda_punch (0.0.6)
5
5
  concurrent-ruby
6
6
  rake
7
7
  rb-inotify
data/README.md CHANGED
@@ -84,7 +84,7 @@ If your application integrates with API Gateway (which has a 30 second timeout)
84
84
 
85
85
  ### Logging
86
86
 
87
- The default log level is `fatal`, so you will not see any LambdaPunch lines in your logs. However, if you want some low level debugging information on how LambdaPunch is working, you can use this environment variable to change the log level.
87
+ The default log level is `error`, so you will not see any LambdaPunch lines in your logs. However, if you want some low level debugging information on how LambdaPunch is working, you can use this environment variable to change the log level.
88
88
 
89
89
  ```yaml
90
90
  Environment:
@@ -16,8 +16,8 @@ module LambdaPunch
16
16
  private
17
17
 
18
18
  def level
19
- l = (@level || ENV['LAMBDA_PUNCH_LOG_LEVEL'] || 'fatal').upcase.to_sym
20
- ::Logger.const_defined?(l) ? ::Logger.const_get(l) : ::Logger::FATAL
19
+ l = (@level || ENV['LAMBDA_PUNCH_LOG_LEVEL'] || 'error').upcase.to_sym
20
+ ::Logger.const_defined?(l) ? ::Logger.const_get(l) : ::Logger::ERROR
21
21
  end
22
22
 
23
23
  end
@@ -1,3 +1,3 @@
1
1
  module LambdaPunch
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -26,17 +26,25 @@ module LambdaPunch
26
26
  new(event_payload).call
27
27
  end
28
28
 
29
- # The `@queue` object is the local process' reference to the application `LambdaPunch::Queue`
30
- # instance which does all the work in the applciation's scope.
29
+ # A safe and resilient way to call the remote queue.
31
30
  #
32
- def queue
33
- @queue
31
+ def call_queue
32
+ queue.call
34
33
  rescue DRb::DRbConnError
34
+ logger.error "Worker#call_queue => DRb::DRbConnError"
35
35
  new_drb_queue
36
+ queue.call
36
37
  end
37
38
 
38
39
  private
39
40
 
41
+ # The `@queue` object is the local process' reference to the application `LambdaPunch::Queue`
42
+ # instance which does all the work in the applciation's scope.
43
+ #
44
+ def queue
45
+ @queue
46
+ end
47
+
40
48
  def new_drb_queue
41
49
  @queue = DRbObject.new_with_uri(Server.uri)
42
50
  end
@@ -58,10 +66,10 @@ module LambdaPunch
58
66
  def call
59
67
  Timeout.timeout(timeout) { @notifier.process }
60
68
  rescue Timeout::Error
61
- logger.debug "Worker#call => Function timeout reached."
69
+ logger.error "Worker#call => Function timeout reached."
62
70
  ensure
63
71
  @notifier.close
64
- self.class.queue.call
72
+ self.class.call_queue
65
73
  end
66
74
 
67
75
  private
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lambda_punch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ken Collins