Yes, I realize there is already #379854: The site map is not being populated, but that one has over 200 replies so can't possibly be related to this exact same issue. I also really don't want to subscribe to that thread since it gets replied to every half hour. ;P

The recent changes to add cron support to xmlsitemap_node, xmlsitemap_user, etc. added a variable for how many records to process on cron (that's good!). However, it defaults to zero, so none of the old content gets picked up on cron run (that's bad!).

Looking under the hood at xmlsitemap_node_cron() I can see why you did this, since you're selecting ALL published nodes and then looping through until $limit is down to zero. But I think that code can probably be refactored so you're doing a db_query_range() to only select $limit records from the node table instead.

Comments

webchick’s picture

Priority: Normal » Critical

Sorry, meant to put that as critical.

avpaderno’s picture

Isn't the default value set to -1?

avpaderno’s picture

Title: Cron limit defaults to 0 and as a result no old content is added to sitemap » Cron maintenance tasks are disabled by default
Status: Active » Postponed (maintainer needs more info)

I am changing the title.
I am not sure this can be called a bug; by default, the cron tasks are not used to populate the database table, but they can be enabled changing the settings.

What do you think the default cron limit should be?

Anonymous’s picture

The default limit should be 100. Off by default isn't good.

avpaderno’s picture

Title: Cron maintenance tasks are disabled by default » Change the default value for the cron limit
Component: xmlsitemap.module » Code
Category: bug » task
Status: Postponed (maintainer needs more info) » Fixed

The default value for the cron limit has been changed in CVS.

dan.crouthamel’s picture

I have a question about this setting. Suppose the default is 100, but you have say 500 nodes. Does that mean 100 nodes are updated on night (cron runs), next 100 another night, etc?

dave reid’s picture

@dan.crouthamel: That is correct. It will only run 100 each time cron is run, unless you specifically change that setting.

Status: Fixed » Closed (fixed)

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