aws-lambda-runner 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/lambda_runner.rb +5 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d4cea03dfb246bf9ca005e26cccd116dad29b3f7
|
4
|
+
data.tar.gz: a9a9da66e3f97d1d25969a45abe465f697d595e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 477578f96e01160206ef09ab46870e26dbddecbd8eaa0299f734363c80aacb6b3ad20f4cb034041f573800c7f5c51454ff835520e00048970fc5ddebd146434b
|
7
|
+
data.tar.gz: 8b34fe0c24c921732197b825952183fd27ad0009ee9759bbfa7c1caf613e72aa7ee6ce67767892c9665ea3483674cb6a5bada5079b4e24cbb5795b1a8ba7ad7f
|
data/lib/lambda_runner.rb
CHANGED
@@ -33,12 +33,15 @@ module LambdaRunner
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def start(opts = { cover: true })
|
36
|
+
if opts[:timeout] == nil
|
37
|
+
opts[:timeout] = '30000'
|
38
|
+
end
|
36
39
|
install_deps
|
37
40
|
add_aws_sdk
|
38
41
|
# start node in a way that emulates how it's run in production
|
39
42
|
cmd = ['node']
|
40
43
|
cmd = [File.join(@npm_cwd, 'node_modules/.bin/istanbul'), 'cover', '--root', File.dirname(@module_path), '--'] if opts[:cover]
|
41
|
-
cmd += [File.join(@npm_cwd, 'startup.js'), '-p', @port.to_s, '-m', @module_path, '-h', @name, '-t',
|
44
|
+
cmd += [File.join(@npm_cwd, 'startup.js'), '-p', @port.to_s, '-m', @module_path, '-h', @name, '-t', opts[:timeout]]
|
42
45
|
@proc = ProcessHelper::ProcessHelper.new(print_lines: true)
|
43
46
|
@proc.start(cmd, 'Server running at http')
|
44
47
|
end
|
@@ -60,7 +63,7 @@ module LambdaRunner
|
|
60
63
|
def send(message)
|
61
64
|
id = RestClient.post(url, message, content_type: :json).to_str
|
62
65
|
loop do
|
63
|
-
wait(RestClient.get(url, params: { id: id }))
|
66
|
+
wait(RestClient.get(url, params: { id: id })) && break
|
64
67
|
sleep(0.1)
|
65
68
|
end
|
66
69
|
end
|