<commit_before><?php
/**
 *
 *
 *
 *
 */

class Hackathon_AsyncIndex_Model_Manager
{

    /**
     * Tells the core indexer to do a partial reindex
     * @param Mage_Index_Model_Process $process
     * @throws Exception
     */
    public function executePartialIndex( Mage_Index_Model_Process $process )
    {
        /** @var $resourceModel Mage_Index_Model_Resource_Process */
        $resourceModel = Mage::getResourceSingleton('index/process');

        if (Mage::getStoreConfigFlag('system/asyncindex/use_transations')) {
            $resourceModel->beginTransaction();
        }

        $indexMode = 'schedule';
        $pendingMode = 'pending';

        //Fallback for 1.6.2 installations > Undefined class constant 'MODE_SCHEDULE'
        if ( true === defined('Mage_Index_Model_Process::MODE_SCHEDULE') ) {
            $indexMode = Mage_Index_Model_Process::MODE_SCHEDULE;
            $pendingMode = Mage_Index_Model_Process::STATUS_PENDING;
        }

        try
        {
            $process->setMode($indexMode);
            $process->indexEvents();
            if ( count(Mage::getResourceSingleton('index/event')->getUnprocessedEvents($process)) === 0 ) {
                $process->changeStatus($pendingMode);
            }
            if (Mage::getStoreConfigFlag('system/asyncindex/use_transations')) {
                $resourceModel->commit();
            }
        }
        catch (Exception $e)
        {
            if (Mage::getStoreConfigFlag('system/asyncindex/use_transations')) {
                $resourceModel->rollBack();
            }
            throw $e;
        }

    }

}<commit_msg>Use the right config path<commit_after><?php
/**
 *
 *
 *
 *
 */

class Hackathon_AsyncIndex_Model_Manager
{

    /**
     * Tells the core indexer to do a partial reindex
     * @param Mage_Index_Model_Process $process
     * @throws Exception
     */
    public function executePartialIndex( Mage_Index_Model_Process $process )
    {
        /** @var $resourceModel Mage_Index_Model_Resource_Process */
        $resourceModel = Mage::getResourceSingleton('index/process');

        if (Mage::getStoreConfigFlag('system/asyncindex/use_transactions')) {
            $resourceModel->beginTransaction();
        }

        $indexMode = 'schedule';
        $pendingMode = 'pending';

        //Fallback for 1.6.2 installations > Undefined class constant 'MODE_SCHEDULE'
        if ( true === defined('Mage_Index_Model_Process::MODE_SCHEDULE') ) {
            $indexMode = Mage_Index_Model_Process::MODE_SCHEDULE;
            $pendingMode = Mage_Index_Model_Process::STATUS_PENDING;
        }

        try
        {
            $process->setMode($indexMode);
            $process->indexEvents();
            if ( count(Mage::getResourceSingleton('index/event')->getUnprocessedEvents($process)) === 0 ) {
                $process->changeStatus($pendingMode);
            }
            if (Mage::getStoreConfigFlag('system/asyncindex/use_transactions')) {
                $resourceModel->commit();
            }
        }
        catch (Exception $e)
        {
            if (Mage::getStoreConfigFlag('system/asyncindex/use_transactions')) {
                $resourceModel->rollBack();
            }
            throw $e;
        }

    }

}
{'fraction_non_alphanumeric': 0.11851396991096101, 'fraction_numerical': 0.002456248081056187, 'mean_word_length': 2.267803410230692, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7657048', 'n_tokens_mistral': 929, 'n_tokens_neox': 897, 'n_words': 138}