Skip to content

Commit

Permalink
https://github.com/thehcginstitute-com/m1/issues/590
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrii-fediuk committed May 2, 2024
1 parent d650501 commit 33c2ff7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
8 changes: 0 additions & 8 deletions app/code/community/Ebizmarts/MailChimp/Model/Cron.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,6 @@ function syncEcommerceBatchData() {\HCG\MailChimp\Batch\Commerce::p();}
*/
function syncSubscriberBatchData():void {\HCG\MailChimp\Batch\Subscriber::p();}

/**
* @used-by app/code/community/Ebizmarts/MailChimp/etc/config.xml
*/
function processWebhookData() {
$p = new Process; /** @var Process $p */
$p->processWebhookData();
}

function deleteWebhookRequests() {
$p = new Process; /** @var Process $p */
$p->deleteProcessed();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ final class Ebizmarts_MailChimp_Model_ProcessWebhook {
/**
* 2024-05-02 Dmitrii Fediuk https://upwork.com/fl/mage2pro
* "Refactor `Ebizmarts_MailChimp_Model_ProcessWebhook`": https://github.com/cabinetsbay/site/issues/590
* @used-by Aoe_Scheduler_Model_Observer::dispatch() (app/code/community/Ebizmarts/MailChimp/etc/config.xml)
* @used-by Ebizmarts_MailChimp_Model_Cron::deleteWebhookRequests()
* @used-by Ebizmarts_MailChimp_Model_Cron::processWebhookData()
*/
function __construct() {
$this->_helper = hcg_mc_h();
Expand All @@ -18,10 +18,11 @@ function __construct() {
}

/**
* @used-by Ebizmarts_MailChimp_Model_Cron::processWebhookData()
* 2024-05-02 Dmitrii Fediuk https://upwork.com/fl/mage2pro
* "Refactor `Ebizmarts_MailChimp_Model_ProcessWebhook`": https://github.com/cabinetsbay/site/issues/590
* @used-by Aoe_Scheduler_Model_Observer::dispatch() (app/code/community/Ebizmarts/MailChimp/etc/config.xml)
*/
function processWebhookData():void
{
function processWebhookData():void {
$collection = Mage::getModel('mailchimp/webhookrequest')->getCollection();
$collection->addFieldToFilter('processed', array('eq' => 0));
$collection->getSelect()->limit(self::BATCH_LIMIT);
Expand Down
2 changes: 1 addition & 1 deletion app/code/community/Ebizmarts/MailChimp/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ https://github.com/thehcginstitute-com/m1/issues/573 -->
<cron_expr>*/5 * * * *</cron_expr>
</schedule>
<run>
<model>mailchimp/cron::processWebhookData</model>
<model>Ebizmarts_MailChimp_Model_ProcessWebhook::processWebhookData</model>
</run>
<groups>ebizmarts_mailchimp</groups>
</mailchimp_process_webhook_data>
Expand Down

0 comments on commit 33c2ff7

Please sign in to comment.