mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
Finally getting sentry to work in feed fetching.
This commit is contained in:
parent
1b7addab44
commit
c5f4734de4
3 changed files with 4 additions and 11 deletions
|
@ -75,7 +75,7 @@ class PushSubscriptionManager(models.Manager):
|
|||
feed=feed, hub=hub, force_retry=True)
|
||||
else:
|
||||
logging.debug(u' ---> [%-30s] ~FR~BKFeed failed to subscribe to push: %s (code: %s)' % (
|
||||
unicode(subscription.feed)[:30], error[:100], response and response.status_code))
|
||||
subscription.feed.log_title[:30], error[:100], response and response.status_code))
|
||||
|
||||
subscription.save()
|
||||
feed.setup_push()
|
||||
|
|
|
@ -1336,7 +1336,6 @@ class Feed(models.Model):
|
|||
original_content = zlib.decompress(existing_story.story_original_content_z)
|
||||
elif existing_story.story_content_z:
|
||||
original_content = zlib.decompress(existing_story.story_content_z)
|
||||
# print 'Type: %s %s' % (type(original_content), type(story_content))
|
||||
if story_content and len(story_content) > 10:
|
||||
if "<code" in story_content:
|
||||
# Don't mangle stories with code, just use new
|
||||
|
|
|
@ -645,14 +645,6 @@ class FeedFetcherWorker:
|
|||
"""Update feed, since it may have changed"""
|
||||
return Feed.get_by_id(feed_id)
|
||||
|
||||
def sentry_process_feed_wrapper(self, feed_queue):
|
||||
try:
|
||||
return self.process_feed_wrapper(feed_queue)
|
||||
except Exception as e:
|
||||
capture_exception(e)
|
||||
flush()
|
||||
raise
|
||||
|
||||
def process_feed_wrapper(self, feed_queue):
|
||||
connection._connections = {}
|
||||
connection._connection_settings ={}
|
||||
|
@ -758,6 +750,8 @@ class FeedFetcherWorker:
|
|||
feed.save_feed_history(feed_code, 'Timeout', e)
|
||||
fetched_feed = None
|
||||
except Exception as e:
|
||||
capture_exception(e)
|
||||
flush()
|
||||
logging.debug('[%d] ! -------------------------' % (feed_id,))
|
||||
tb = traceback.format_exc()
|
||||
logging.error(tb)
|
||||
|
@ -959,4 +953,4 @@ class Dispatcher:
|
|||
|
||||
def dispatch_workers(feed_queue, options):
|
||||
worker = FeedFetcherWorker(options)
|
||||
return worker.sentry_process_feed_wrapper(feed_queue)
|
||||
return worker.process_feed_wrapper(feed_queue)
|
||||
|
|
Loading…
Add table
Reference in a new issue