Skip to content
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

#557 fix high memory and cpu usage in cron job #500

Open
wants to merge 1 commit into
base: master-2.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Cron/CancelPendingOrders.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,17 @@ public function execute()
{
$this->logger->info("Cronjob: Cancel Pending Order Cron started.");
$dateTimeCheck = date('Y-m-d H:i:s', strtotime('-' . $this->pendingOrderTimeout . ' minutes'));
$minTimeCheck = date('Y-m-d H:i:s', strtotime('-10 days'));
$sortOrder = $this->sortOrderBuilder->setField('entity_id')->setDirection('DESC')->create();
$searchCriteria = $this->searchCriteriaBuilder
->addFilter(
'updated_at',
$dateTimeCheck,
'lt'
)->addFilter(
'updated_at',
$minTimeCheck,
'gt'
)->addFilter(
'status',
static::STATUS_PENDING,
Expand Down
2 changes: 1 addition & 1 deletion Setup/UpgradeSchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function upgrade(
}
}

$tableName = $setup->getTable(OrderLink::TABLE_NAME);
$tableName = $setup->getTable('sales_order');
if ($setup->getConnection()->isTableExists($tableName) == true)
{
$setup->getConnection()->addColumn(
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "razorpay/magento",
"description": "Razorpay Magento 2.0 plugin for accepting payments.",
"version": "4.1.6",
"version": "4.1.7",
"require": {
"php": "7.*|^8.1",
"razorpay/razorpay": "2.*"
Expand Down
2 changes: 1 addition & 1 deletion etc/module.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Razorpay_Magento" setup_version="4.1.6">
<module name="Razorpay_Magento" setup_version="4.1.7">
<sequence>
<module name="Magento_Sales" />
<module name="Magento_Payment" />
Expand Down