File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
app/code/Magento/Catalog/Model/ResourceModel Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,11 @@ class MaxHeapTableSizeProcessor
16
16
*/
17
17
protected $ connection ;
18
18
19
+ /**
20
+ * @var int
21
+ */
22
+ protected $ defaultMaxHeapTableSie ;
23
+
19
24
/**
20
25
* Current max_heap_table_size value (in Bytes)
21
26
*
@@ -29,18 +34,19 @@ class MaxHeapTableSizeProcessor
29
34
public function __construct (ResourceConnection $ resource )
30
35
{
31
36
$ this ->connection = $ resource ->getConnection ();
37
+ $ this ->defaultMaxHeapTableSie = 1024 * 1024 * 64 ;
32
38
}
33
39
34
40
/**
35
41
* Set max_heap_table_size value in Bytes. By default value is 64M
36
42
*
37
- * @param int $maxHeapTableSize
43
+ * @param int|null $maxHeapTableSize
38
44
* @throws \InvalidArgumentException
39
45
* @throws \RuntimeException
40
46
*/
41
- public function set ($ maxHeapTableSize = 1024 * 1024 * 64 )
47
+ public function set ($ maxHeapTableSize = null )
42
48
{
43
- $ maxHeapTableSize = (int )$ maxHeapTableSize ;
49
+ $ maxHeapTableSize = (int ) ( null === $ maxHeapTableSize ? $ this -> defaultMaxHeapTableSie : $ maxHeapTableSize ) ;
44
50
if (!$ maxHeapTableSize ) {
45
51
throw new \InvalidArgumentException ('Wrong max_heap_table_size parameter ' );
46
52
}
You can’t perform that action at this time.
0 commit comments