When a feed cannot be refreshed, I want to be alerted

roychri - April 22, 2008 - 18:38
Project:FeedAPI
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs work
Description

When there is a problem with the feed itself (website down, feed corrupted) and cron runs, there's no indication that a problem occurred. Nothing in the watchdog for example. It would be awesome if there was a way for me to run some code when the feed cannot be refreshed from cron, or at the very least, logging an error using watchdog.

#1

roychri - April 22, 2008 - 19:16
Version:6.x-1.2» 5.x-1.2
Status:active» needs review

Ooops. Wrong version. This is for 5.x

#2

roychri - April 22, 2008 - 19:26

This patch calls watchdog() and creates a new hook called hook_feedapi_error().
So if I want something special to happen on error, I simply have to create

function mymodule_feedapi_error($feed) {
  ....
}

Since this only fires on error, which should not happen often, the extra overhead of the hook will not slow the application down.

What do you think?

AttachmentSize
249866.patch 664 bytes

#3

mustafau - May 20, 2008 - 19:06
Version:5.x-1.2» 6.x-1.x-dev
Status:needs review» needs work

I think a hook is not necessary. A watchdog call should be enough.

#4

roychri - June 12, 2008 - 15:57

Without the hook, how can I have it send me an email when it fails?
That's one of our requirement and I would rather having to avoid changing the code of feedapi for my project.
Since this hook is only run on error, it would not pose any significant performance problems.
Let me know.

 
 

Drupal is a registered trademark of Dries Buytaert.