Skip to content

Commit 8c82dc1

Browse files
committed
ACP2E-2123: Issues with some pending crons that are not been executed
1 parent 5b9aca2 commit 8c82dc1

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

InventoryIndexer/Plugin/InventoryApi/ReindexAfterSourceItemsSavePlugin.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,13 @@
77

88
namespace Magento\InventoryIndexer\Plugin\InventoryApi;
99

10+
use Magento\Framework\Exception\LocalizedException;
1011
use Magento\InventoryApi\Api\Data\SourceItemInterface;
1112
use Magento\InventoryApi\Api\SourceItemsSaveInterface;
1213
use Magento\InventoryCatalogApi\Api\DefaultSourceProviderInterface;
1314
use Magento\InventoryIndexer\Indexer\SourceItem\GetSourceItemIds;
1415
use Magento\InventoryIndexer\Indexer\SourceItem\SourceItemIndexer;
1516

16-
/**
17-
* Reindex after source items save plugin
18-
*/
1917
class ReindexAfterSourceItemsSavePlugin
2018
{
2119
/**
@@ -49,10 +47,13 @@ public function __construct(
4947
}
5048

5149
/**
50+
* Run reindex process for saved source items
51+
*
5252
* @param SourceItemsSaveInterface $subject
5353
* @param void $result
5454
* @param SourceItemInterface[] $sourceItems
5555
* @return void
56+
* @throws LocalizedException
5657
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
5758
*/
5859
public function afterExecute(
@@ -67,6 +68,12 @@ public function afterExecute(
6768
}
6869
}
6970

71+
/**
72+
* Remove items with default source
73+
*
74+
* @param array $sourceItems
75+
* @return array
76+
*/
7077
private function sanitizeSources(array $sourceItems) : array
7178
{
7279
$result = [];

0 commit comments

Comments
 (0)