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 +4 -4
- data/CHANGELOG.md +5 -0
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/lambda_punch/logger.rb +2 -2
- data/lib/lambda_punch/version.rb +1 -1
- data/lib/lambda_punch/worker.rb +14 -6
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: acb3627a0b668ca042411a2458ac2f203964b9c4e7989261d089c3f26daa7034
|
4
|
+
data.tar.gz: 4b5a88989a40d9596473e603b0ffbf00d702bc550b6c0f330a380632d036fcac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ea4db3eb1b7ff42b5158d110e9cd4147945794a2e4e976826c3697230a38d6ef4ce640d436928f07e78bd3f396f0ccbc2256765eb22f51d66b24a764e7b3190
|
7
|
+
data.tar.gz: 30274ee2debd3d74f9e486934120c78669e38ec1a1761254fb0281fdaf412a2440ea8f51aed6bc8317aa51c7ece88774d4b6d8495c2791e3ff7cd186bfdaba2d
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
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 `
|
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:
|
data/lib/lambda_punch/logger.rb
CHANGED
@@ -16,8 +16,8 @@ module LambdaPunch
|
|
16
16
|
private
|
17
17
|
|
18
18
|
def level
|
19
|
-
l = (@level || ENV['LAMBDA_PUNCH_LOG_LEVEL'] || '
|
20
|
-
::Logger.const_defined?(l) ? ::Logger.const_get(l) : ::Logger::
|
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
|
data/lib/lambda_punch/version.rb
CHANGED
data/lib/lambda_punch/worker.rb
CHANGED
@@ -26,17 +26,25 @@ module LambdaPunch
|
|
26
26
|
new(event_payload).call
|
27
27
|
end
|
28
28
|
|
29
|
-
#
|
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
|
33
|
-
|
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.
|
69
|
+
logger.error "Worker#call => Function timeout reached."
|
62
70
|
ensure
|
63
71
|
@notifier.close
|
64
|
-
self.class.
|
72
|
+
self.class.call_queue
|
65
73
|
end
|
66
74
|
|
67
75
|
private
|