The daily listing update seems to end before the old listing are removed. So now the database is accumulating out-dated properties. For example there are 10K current single family listings but my database has 15K single family listings. I need to weed out the old stuff without flushing because there is a whole showing management system set up based on the properties in the database, if I flush those, I lose the node-reference for the showings.

This is the function but what is needed for $context?
pirets_class_update_batch_del(&$context)

Comments

Garrett Albright’s picture

If cron runs are happening without listings being deleted, something is wrong. Either the process is being stopped before the deletions happen, or something is causing PIRETS to think that the listings don't need to be deleted.

The function you're looking at is one called during a property class update process to delete properties which don't appear in the remote RETS database anymore. It can't really be called on its own.

jday’s picture

yes something is definitely wrong, the update gets to 66% complete then after several minutes goes to a 'page not found' state, and sometimes throws an error:

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in db_result()

scott_earnest’s picture

I was having a similar problem - but it looked like cron was completing ok. I discovered that it was getting to the spot where it called node_delete but just wasn't deleting the node. I found out that node_delete does not seem to work in a cron since it is running as user "Guest". I used some code from the doc page below to switch into user 1 during the pirets_class_update_batch() function in pirets.batch.inc.

http://drupal.org/node/218104

jday’s picture

Thanks Scott, I added the 'switch to user 1' code to the update batch function and now I am seeing old listings getting deleted in the log...but I'm still getting log entries for 'Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in db_result()' though....baby steps

anyway, I appreciate your help