We will be off from 27/1 (Monday) to 31/1 (Friday) (GMT +7) for our Tet Holiday (Lunar New Year) in our country

Commit 3a4a37a1 authored by Shruti Holennavar's avatar Shruti Holennavar

Added new column processing to adyen notification table to know if...

Added new column processing to adyen notification table to know if notification record is already processing under other cron-job
parent 7a5f8041
......@@ -224,8 +224,17 @@ class Cron
// create collection
$notifications = $this->_notificationFactory->create();
$notifications->addFieldToFilter('done', 0);
$notifications->addFieldToFilter('processing', 0);
$notifications->addFieldToFilter('created_at', $dateRange);
foreach ($notifications as $notification) {
// set Cron processing to true
$dateEnd = new \DateTime();
$notification->setProcessing(true);
$notification->setUpdatedAt($dateEnd);
$notification->save();
}
// loop over the notifications
$count = 0;
foreach ($notifications as $notification) {
......
......@@ -59,6 +59,10 @@ class UpgradeSchema implements UpgradeSchemaInterface
$this->updateSchemaVersion204($setup);
}
if (version_compare($context->getVersion(), '2.0.6', '<')) {
$this->updateSchemaVersion206($setup);
}
$setup->endSetup();
}
......@@ -262,4 +266,32 @@ class UpgradeSchema implements UpgradeSchemaInterface
]
);
}
/**
* Upgrade to 2.0.6
*
* @param SchemaSetupInterface $setup
* @return void
*/
public function updateSchemaVersion206(SchemaSetupInterface $setup)
{
$connection = $setup->getConnection();
$tableName = $setup->getTable('adyen_notification');
$adyenNotificationProcessingColumn = [
'type' => Table::TYPE_BOOLEAN,
'length' => 1,
'nullable' => true,
'default' => 0,
'comment' => 'Adyen Notification Cron Processing',
'after' => \Adyen\Payment\Model\Notification::DONE
];
$connection->addColumn(
$tableName,
'processing',
$adyenNotificationProcessingColumn
);
}
}
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment