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

Mark indexProcess as STATUS_REQUIRE_REINDEX; it is cleared after #574

Open
wants to merge 1 commit into
base: 1.9.3.x
from

Conversation

Projects
None yet
5 participants
@seansan
Copy link
Contributor

commented Nov 28, 2018

Mark indexProcess as STATUS_REQUIRE_REINDEX

it is cleared directly after if the indexer can run

$indexProcess->changeStatus(Mage_Index_Model_Process::STATUS_REQUIRE_REINDEX);

if it cannot then at least the indexer is marked as dirty

(sometimes the indexer is already running and the process cannot start; in this case there is no way to see this for the admin or some watching process)

Mark indexProcess as STATUS_REQUIRE_REINDEX; it is cleared after
Mark indexProcess as STATUS_REQUIRE_REINDEX

it is cleared directly after if the indexer can run

$indexProcess->changeStatus(Mage_Index_Model_Process::STATUS_REQUIRE_REINDEX);

if it cannot then at least the indexer is marked as dirty

(sometimes the indexer is already running and the process cannot start; in this case there is no way to see this for the admin or some watching process)
@colinmollenhour
Copy link
Contributor

left a comment

Looks like a great suggestion to me!

Also, shouldn't the cache be invalidated after the reindex is done rather than before?

@seansan

This comment has been minimized.

Copy link
Contributor Author

commented Dec 11, 2018

@colinmollenhour

This comment has been minimized.

Copy link
Contributor

commented Dec 11, 2018

Sorry, two lines up it calls $this->_invalidateCache();. It is a separate issue but it seems to me invalidating the cache before the indexes are updated is useless since the cache will potentially be re-warmed with the old data before the indexing is complete.

@tbaden tbaden added the Review Needed label Jun 1, 2019

@@ -318,6 +318,7 @@ public function applyAll()
$this->_getResource()->applyAllRules();
$this->_invalidateCache();
$indexProcess = Mage::getSingleton('index/indexer')->getProcessByCode('catalog_product_price');
$indexProcess->changeStatus(Mage_Index_Model_Process::STATUS_REQUIRE_REINDEX);

This comment has been minimized.

Copy link
@tmotyl

tmotyl Jun 6, 2019

Contributor

getProcessByCode('catalog_product_price') can return false so in order to avoid fatal error we need to call this method inside if statement

@tmotyl

This comment has been minimized.

Copy link
Contributor

commented Jun 6, 2019

@seansan can you point me to the place where the flag is removed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.