summaryrefslogtreecommitdiff
path: root/plugins/OStatus/classes/FeedSub.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-02-21 13:40:59 -0800
committerBrion Vibber <brion@pobox.com>2010-02-21 13:40:59 -0800
commit5349aa420ed45c2f5bf773d10c7709826ae6babd (patch)
treeaee4444ba48f9e84c77ff6660daaf5d8ee15a2f7 /plugins/OStatus/classes/FeedSub.php
parent10f6c023f4573868326c4b6599bdfb66cffdd7d6 (diff)
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.
Diffstat (limited to 'plugins/OStatus/classes/FeedSub.php')
-rw-r--r--plugins/OStatus/classes/FeedSub.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/plugins/OStatus/classes/FeedSub.php b/plugins/OStatus/classes/FeedSub.php
index bf9d063fa..31241d3de 100644
--- a/plugins/OStatus/classes/FeedSub.php
+++ b/plugins/OStatus/classes/FeedSub.php
@@ -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));
}