codeclimate 0.9.6 → 0.9.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/cc/analyzer/engine.rb +8 -1
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cbf1a450836e1aae3fa7a439b91182e09a32a03a
4
- data.tar.gz: 9cfbc95b32582886a5b424ff9dd84ef385480ecc
3
+ metadata.gz: b5ec325a3de6407e16d0ec265e3512751dc98d16
4
+ data.tar.gz: 6902de17324c521e01d589e65fdedaf12b893808
5
5
  SHA512:
6
- metadata.gz: 6c06a9d57fa76e8f92094aca185ac551a504b48ec1671e624f9351e600f45678c9c5d330d92daeadf26d1d3f7a79f81aba8b4e04c46427bc0bd2228ed14803e4
7
- data.tar.gz: 334e4200e977139c39b5e05c9f83853206a59dd9387d69b0cd49f363de065daf6c165e44326d66b5fbc308ae940001ad7f33b1ab92fe7d8f783bc72c9e095639
6
+ metadata.gz: 40ad03e9e1d47bd3fc36d1e079d5d215493515518eb1f95a52869b514dc0bc6a1a668af0b84ee68359ebd351a7f0f711a5a339d7f90abcbf551ce8e0af573330
7
+ data.tar.gz: 0fa3d26b50dbceeef4819d30db2d3cf0a9c6f5385cad4186d03c68b47b5ce3c6cbd103628043a04ab0f831a22a52cd9e011785e255bb66218f694669b161ec77
@@ -8,6 +8,8 @@ module CC
8
8
 
9
9
  attr_reader :name
10
10
 
11
+ DEFAULT_MEMORY_LIMIT = 512_000_000.freeze
12
+
11
13
  def initialize(name, metadata, code_path, config, label)
12
14
  @name = name
13
15
  @metadata = metadata
@@ -46,7 +48,7 @@ module CC
46
48
  [
47
49
  "--cap-drop", "all",
48
50
  "--label", "com.codeclimate.label=#{@label}",
49
- "--memory", 512_000_000.to_s, # bytes
51
+ "--memory", memory_limit,
50
52
  "--memory-swap", "-1",
51
53
  "--net", "none",
52
54
  "--volume", "#{@code_path}:/code:ro",
@@ -68,6 +70,11 @@ module CC
68
70
  def output_filter
69
71
  @output_filter ||= EngineOutputFilter.new(@config)
70
72
  end
73
+
74
+ # Memory limit for a running engine in bytes
75
+ def memory_limit
76
+ (ENV["ENGINE_MEMORY_LIMIT_BYTES"] || DEFAULT_MEMORY_LIMIT).to_s
77
+ end
71
78
  end
72
79
  end
73
80
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: codeclimate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.6
4
+ version: 0.9.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code Climate