File tree 3 files changed +20
-3
lines changed
3 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,10 @@ public function executePartialIndex( Mage_Index_Model_Process $process )
18
18
{
19
19
/** @var $resourceModel Mage_Index_Model_Resource_Process */
20
20
$ resourceModel = Mage::getResourceSingleton ('index/process ' );
21
- $ resourceModel ->beginTransaction ();
21
+
22
+ if (Mage::getStoreConfigFlag ('system/asyncindex/use_transactions ' )) {
23
+ $ resourceModel ->beginTransaction ();
24
+ }
22
25
23
26
$ indexMode = 'schedule ' ;
24
27
$ pendingMode = 'pending ' ;
@@ -36,11 +39,15 @@ public function executePartialIndex( Mage_Index_Model_Process $process )
36
39
if ( count (Mage::getResourceSingleton ('index/event ' )->getUnprocessedEvents ($ process )) === 0 ) {
37
40
$ process ->changeStatus ($ pendingMode );
38
41
}
39
- $ resourceModel ->commit ();
42
+ if (Mage::getStoreConfigFlag ('system/asyncindex/use_transactions ' )) {
43
+ $ resourceModel ->commit ();
44
+ }
40
45
}
41
46
catch (Exception $ e )
42
47
{
43
- $ resourceModel ->rollBack ();
48
+ if (Mage::getStoreConfigFlag ('system/asyncindex/use_transactions ' )) {
49
+ $ resourceModel ->rollBack ();
50
+ }
44
51
throw $ e ;
45
52
}
46
53
Original file line number Diff line number Diff line change 94
94
<auto_index >1</auto_index >
95
95
<scheduler_cron_expr >*/5 * * * *</scheduler_cron_expr >
96
96
<event_limit >100</event_limit >
97
+ <use_transactions >1</use_transactions >
97
98
</asyncindex >
98
99
</system >
99
100
</default >
Original file line number Diff line number Diff line change 60
60
<show_in_website >0</show_in_website >
61
61
<show_in_store >0</show_in_store >
62
62
</blacklist_indexes >
63
+ <use_transactions >
64
+ <label >Use Transactions for Partial Index</label >
65
+ <frontend_type >select</frontend_type >
66
+ <source_model >adminhtml/system_config_source_yesno</source_model >
67
+ <sort_order >60</sort_order >
68
+ <show_in_default >1</show_in_default >
69
+ <show_in_website >0</show_in_website >
70
+ <show_in_store >0</show_in_store >
71
+ </use_transactions >
63
72
</fields >
64
73
</asyncindex >
65
74
</groups >
You can’t perform that action at this time.
0 commit comments