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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/lambda_runner.rb +5 -2
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0bcd4937c0e10b5e7a0601406c1eb22f36da5d85
4
- data.tar.gz: 105b4d4144d2bd73de84bb9f50ce02e63087b0f2
3
+ metadata.gz: d4cea03dfb246bf9ca005e26cccd116dad29b3f7
4
+ data.tar.gz: a9a9da66e3f97d1d25969a45abe465f697d595e3
5
5
  SHA512:
6
- metadata.gz: 51002e44f87ac3d99a319a1495a62a936c00ea0cd1cc9fe8fb485d66e01a667f235a9eee4d9a1b45115e6963d8f2ffac4c084a74c08c134bb803673114e6e8a6
7
- data.tar.gz: d650889fb646cce2254ab8c9a25a9a5e57584c41ef2cdd8bc94c086b522616301db56ef31103340b65193e00a9a35a60ee37834f2b1ba6dc36aca5309fa246d0
6
+ metadata.gz: 477578f96e01160206ef09ab46870e26dbddecbd8eaa0299f734363c80aacb6b3ad20f4cb034041f573800c7f5c51454ff835520e00048970fc5ddebd146434b
7
+ data.tar.gz: 8b34fe0c24c921732197b825952183fd27ad0009ee9759bbfa7c1caf613e72aa7ee6ce67767892c9665ea3483674cb6a5bada5079b4e24cbb5795b1a8ba7ad7f
@@ -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', '1000']
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 })) || break
66
+ wait(RestClient.get(url, params: { id: id })) && break
64
67
  sleep(0.1)
65
68
  end
66
69
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-lambda-runner
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - andrew wheat