-
Notifications
You must be signed in to change notification settings - Fork 248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MSI-2522: Introduce yielding for order list iterations and use paging #2573
MSI-2522: Introduce yielding for order list iterations and use paging #2573
Conversation
*/ | ||
public function getOrderIncrementId(): string | ||
{ | ||
return (string)$this->orderIncrementId; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need cast here
@@ -25,7 +25,7 @@ public function execute(array $inconsistencies): array | |||
return array_filter( | |||
$inconsistencies, | |||
function (SalableQuantityInconsistency $inconsistency) { | |||
return (bool)$inconsistency->getOrder(); | |||
return $inconsistency->hasAssignedOrder() !== false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please get rid of !== false
yield $item->getEntityId() => $item; | ||
} | ||
|
||
gc_collect_cycles(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need it?
Closing, as #2578 includes these changes |
Introduce yielding for order iterations to improve memory usage.
Description (*)
Extends
GetOrdersInFinalState
andGetOrdersInNotFinalState
classes in order to return\Traversable
while usingyield
.Test results with 1255 orders:
Fixed Issues (if relevant)
Manual testing scenarios (*)
2.3-develop
branchbin/magento inventory:reservation:list-inconsistencies
MSI-2522-consistency-cli-mem-usage-improvements
branchbin/magento inventory:reservation:list-inconsistencies
Contribution checklist (*)