Skip to content

Commit e50dd6d

Browse files
committed
AC-13358: RestApi request '/rest/default/V1/categories?searchCriteria%5Bpage_size%5D=1' fails with timeout error
Updated default depth to 3
1 parent 37b996e commit e50dd6d

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

app/code/Magento/Catalog/Plugin/CategoryManagementPerformanceOptimizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
class CategoryManagementPerformanceOptimizer
1717
{
18-
private const DEFAULT_MAX_DEPTH = 1; // Limit depth to prevent timeouts
18+
private const DEFAULT_MAX_DEPTH = 3; // Limit depth to prevent timeouts
1919

2020
/**
2121
* Optimize getTree method with depth limits to prevent timeouts

dev/tests/api-functional/testsuite/Magento/Catalog/Api/CategoryManagementTest.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22
/**
33
*
4-
* Copyright 2015 Adobe
5-
* All rights reserved.
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
66
*/
77

88
namespace Magento\Catalog\Api;
@@ -16,8 +16,9 @@
1616
*/
1717
class CategoryManagementTest extends WebapiAbstract
1818
{
19-
private const RESOURCE_PATH = '/V1/categories';
20-
private const SERVICE_NAME = 'catalogCategoryManagementV1';
19+
const RESOURCE_PATH = '/V1/categories';
20+
21+
const SERVICE_NAME = 'catalogCategoryManagementV1';
2122

2223
/**
2324
* @var CompareArraysRecursively
@@ -95,7 +96,7 @@ public static function treeDataProvider(): array
9596
],
9697
[
9798
2,
98-
3,
99+
null,
99100
[
100101
'id' => 2,
101102
'name' => 'Default Category',
@@ -124,7 +125,7 @@ public static function treeDataProvider(): array
124125
],
125126
[
126127
400,
127-
null, // Default depth is 1
128+
1,
128129
[
129130
'id' => 400,
130131
'name' => 'Category 1',

0 commit comments

Comments
 (0)