ACP2E-4748: Reward points expiration runs slowly on stores with a large reward points history…
Reward points expiration runs slowly on stores with a large reward points history, causing delays in expiring reward points. Quality patch ACP2E-4748 for magento/module-reward applies to Magento Open Source and Adobe Commerce 2.4.7 to 2.4.8-p5.
- Categories
- Customer, Performance
- Components
- magento/module-reward
- Origin
- adobe-commerce-support
- Since QPT
- 1.1.82
Issue
Reward points expiration runs slowly on stores with a large reward points history, causing delays in expiring reward points.
Steps to reproduce
1. Go to Admin > Stores > Settings > Configuration > Customers > Reward Points. 1. Set Enable Reward Points Functionality to Yes, set Reward Points Expire in (days) to a positive value, and then click Save Config. 1. Confirm that the magento_reward and magento_reward_history tables contain a very large number of records. 1. Wait for the magento_reward_expire_points cron job to execute. 1. Measure the execution time of the query executed by Magento\Reward\Model\ResourceModel\Reward\History::expirePoints().
Adobe's page lists 2.4.7 - 2.4.8-p5 as compatible; the versions below are resolved from the current QPT constraints and are the ones the tool will offer.
Adobe scheduled the permanent fix for 2.4.9.
Install
Install the Quality Patches Tool with composer require magento/quality-patches, apply the prerequisites listed for all files applicable to your distribution and version first, then run vendor/bin/magento-patches apply ACP2E-4748. On Cloud, add ACP2E-4748 under stage.build.QUALITY_PATCHES in .magento.env.yaml.
For cweagans/composer-patches, choose a compatible version below and download the bundle. Copy its ACP2E-4748/ folder into patches/composer/, merge composer.patches.json into composer.json, then run composer install. Bundle prerequisites the same way and list them first. Paths are relative to each package root, using the default -p1 level. Prefer local files when configuring composer-patches; a remote URL can change.
Patch files and compatible versions
magento/magento2-ee-base >=2.4.7 <2.4.9
- Magento Open Source
- —
- vendor/magento/module-reward/Cron/ScheduledPointsExpiration.php
- vendor/magento/module-reward/Model/ResourceModel/Reward/History.php
- vendor/magento/module-reward/etc/db_schema.xml
- vendor/magento/module-reward/etc/db_schema_whitelist.json
- vendor/magento/module-reward/etc/di.xml
