1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <?php
- if (!defined('STATUSNET')) {
- exit(1);
- }
- class PushRenewQueueHandler extends QueueHandler
- {
- function transport()
- {
- return 'pushrenew';
- }
- function handle($data)
- {
- $feedsub_id = $data['feedsub_id'];
- $feedsub = FeedSub::getKV('id', $feedsub_id);
- if ($feedsub instanceof FeedSub) {
- try {
- common_log(LOG_INFO, "Renewing feed subscription\n\tExp.: {$feedsub->sub_end}\n\tFeed: {$feedsub->uri}\n\tHub: {$feedsub->huburi}");
- $feedsub->renew();
- } catch(Exception $e) {
- common_log(LOG_ERR, "Exception during WebSub renew processing for $feedsub->uri: " . $e->getMessage());
- }
- } else {
- common_log(LOG_ERR, "Discarding renew for unknown feed subscription id $feedsub_id");
- }
- return true;
- }
- }
|