codeclimate 0.9.6 → 0.9.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cc/analyzer/engine.rb +8 -1
- 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: b5ec325a3de6407e16d0ec265e3512751dc98d16
|
4
|
+
data.tar.gz: 6902de17324c521e01d589e65fdedaf12b893808
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 40ad03e9e1d47bd3fc36d1e079d5d215493515518eb1f95a52869b514dc0bc6a1a668af0b84ee68359ebd351a7f0f711a5a339d7f90abcbf551ce8e0af573330
|
7
|
+
data.tar.gz: 0fa3d26b50dbceeef4819d30db2d3cf0a9c6f5385cad4186d03c68b47b5ce3c6cbd103628043a04ab0f831a22a52cd9e011785e255bb66218f694669b161ec77
|
data/lib/cc/analyzer/engine.rb
CHANGED
@@ -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",
|
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
|