OStatus feedsub fixlets:

- actually udpate feedsub.last_update when we get a new PuSH update in
- move incoming PuSH processing to a queue handler to minimize time spent before POST return, as recommended by PuSH spec. When queues are disabled this'll still be handled immediately.
This commit is contained in:
Brion Vibber
2010-02-21 13:40:59 -08:00
parent 10f6c023f4
commit 5349aa420e
4 changed files with 70 additions and 2 deletions

View File

@@ -372,6 +372,12 @@ class FeedSub extends Memcached_DataObject
* feed (as a DOMDocument) will be passed to the StartFeedSubHandleFeed
* and EndFeedSubHandleFeed events for processing.
*
* Not guaranteed to be running in an immediate POST context; may be run
* from a queue handler.
*
* Side effects: the feedsub record's lastupdate field will be updated
* to the current time (not published time) if we got a legit update.
*
* @param string $post source of Atom or RSS feed
* @param string $hmac X-Hub-Signature header, if present
*/
@@ -402,6 +408,10 @@ class FeedSub extends Memcached_DataObject
return;
}
$orig = clone($this);
$this->last_update = common_sql_now();
$this->update($orig);
Event::handle('StartFeedSubReceive', array($this, $feed));
Event::handle('EndFeedSubReceive', array($this, $feed));
}