Aggregation nodes not purging on anonymous cron runs
j9 - March 23, 2009 - 18:35
| Project: | Aggregation |
| Version: | 6.x-1.8 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
Hi - I've set the purge day # to 1 and cron is completing every hour, but I see nodes from over 3 days ago still on the site and no mention of deletions in the aggregation logs. Im using 6.x.1-8 on drupal 6.10. Does anyone else have an issue of nodes not purging on these versions?

#1
i changed the delete after period to three days and items are now being purged.
#2
Hi again -
I am running multisites w/ aggregation and use cron-curl.sh with
curl --silent --compressed http://www.example1.com/cron.php
curl --silent --compressed http://www.example2.com/cron.php
curl --silent --compressed http://www.example3.com/cron.php
etc in the cron-curl.sh file.
Cron is running on the sites, but I do not see content being deleted (purged) as it should for the cron run. Aggregation is adding new items from the feeds w/ the cron run, but not deleting items.
*Sometimes,* when I manually run cron from the Status report, items are purged correctly. Sometimes they don't. Sometimes, if I decrease the purge period by four days, like 10 days down to 6, it doesnt purge, but if I put it then from 6 up to an 8 day old purge period, it will purge. Its very incosistent and I dont know if it has to do w/ Drupal cron.php or with Aggregation.
The cron-curl.sh script I have chmod'ed to 755. I've also tried it w/ cron-lynx.sh
Is there a php setting or something else that might not be allowing cron to do the purging necessary w/ aggregation?
Any help would be much appreciated. Thanks very much -
#3
#4
On line 249 of aggregation.module 6.x-1-8, I see this computation:
if ($feed->time_to_live > 0)
{
$items_to_be_deleted = db_query("SELECT n.nid FROM {node} n, ".
"{aggregation_item} ai WHERE n.nid = ai.nid AND ai.fid = %d AND ".
"(%d - n.created) >= %d", $feed->nid, time(),
$feed->time_to_live * 24 * 60 * 60);
while ($item = db_fetch_object($items_to_be_deleted))
node_delete($item->nid);
}
}
catch (Exception $e) {
watchdog('aggregation', check_plain($e->getMessage()), NULL, WATCHDOG_ERROR, l(t('view'), "node/$feed->nid"));
}
}
if (!ini_get('safe_mode') && is_numeric($max_exec_time) && $max_exec_time > 0)
set_time_limit($max_exec_time);
}
What would the max_exec_time need to be to forgive any exception in this case?
I've got one set way up in my php.ini as follows:
max_execution_time = 3000 ; Maximum execution time of each script, in seconds;max_execution_time = 30 ; Maximum execution time of each script, in seconds
Is there any chance that this is not sufficient? Im changing it to 6000 now to see if that fixes the issue.
Thanks very much for any support with this issue -
#5
I'd like to add that if I'm logged in, and go to the example.com/cron.php url, it *does* purge -- *except* when I first try to run it anonymously, and then log in and try cron.php (*or* even try the Run Cron Manually button on status report).
So there seems to be a cron timing issue and a session or login issue related to running cron and having the nodes purged from aggregation.
If an anonymous user goes to cron.php, it *does not* purge, though it retreives new feed items fine under anon user.
#6
#7
I have the same issue too.
The content was purged when I changed "time to live" from 7 to 3 days and ran cron manually from "Status report" under my user name. During the next several days auto deletion function hadn't been working. I've ran cron manually again, but without any result.