Problem/Motivation

Noticed that node_cron() is quite slow with a lot of nodes and and we actually don't use search.module, so what it is doing is pointless.

Proposed resolution

Add a moduleExists() check for search around it.

Remaining tasks

User interface changes

API changes

CommentFileSizeAuthor
#1 2484667-node_cron-check-1.patch1.51 KBjoshi.rohit100
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

joshi.rohit100’s picture

Status: Active » Needs review
FileSize
1.51 KB
Berdir’s picture

Status: Needs review » Reviewed & tested by the community

Thanks, looks good. We could add a test that runs the code without search module enabled and then verifies that state wasn't set, but I'm not sure if that's really worth it?

xjm’s picture

Status: Reviewed & tested by the community » Fixed

Nice catch. Agreed that a test isn't really necessary.

As a performance improvement, this issue is a prioritized change as per https://www.drupal.org/core/beta-changes and its benefits outweigh any disruption. Committed and pushed to 8.0.x. Thanks @Berdir and @joshi.rohit100!

  • xjm committed 1bc5359 on 8.0.x
    Issue #2484667 by joshi.rohit100, Berdir: Do not run query in node_cron...
joshi.rohit100’s picture

Do we need the same for comment ?

Berdir’s picture

Actually yes, that seems like a good idea and same problem. Want to open an issue?

joshi.rohit100’s picture

Yes thats the question. Should it be in this issue as it is related or separate ? :)

Berdir’s picture

New issue as this one has been committed already.

joshi.rohit100’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.