예제 #1
0
                    logging.debug("   ---> [%-30s] ~FRPage fetch timed out..." % (feed.title[:30]))
                    page_data = None
                    feed.save_page_history(555, "Timeout", "")
                except Exception, e:
                    logging.debug("[%d] ! -------------------------" % (feed_id,))
                    tb = traceback.format_exc()
                    logging.error(tb)
                    logging.debug("[%d] ! -------------------------" % (feed_id,))
                    feed.save_page_history(550, "Page Error", tb)
                    fetched_feed = None
                    page_data = None
                    mail_feed_error_to_admin(feed, e, local_vars=locals())

                feed = self.refresh_feed(feed.pk)
                logging.debug(u"   ---> [%-30s] ~FYFetching icon: %s" % (feed.title[:30], feed.feed_link))
                icon_importer = IconImporter(feed, page_data=page_data, force=self.options["force"])
                try:
                    icon_importer.save()
                    icon_duration = time.time() - start_duration
                except TimeoutError, e:
                    logging.debug("   ---> [%-30s] ~FRIcon fetch timed out..." % (feed.title[:30]))
                    feed.save_page_history(556, "Timeout", "")
                except Exception, e:
                    logging.debug("[%d] ! -------------------------" % (feed_id,))
                    tb = traceback.format_exc()
                    logging.error(tb)
                    logging.debug("[%d] ! -------------------------" % (feed_id,))
                    # feed.save_feed_history(560, "Icon Error", tb)
                    mail_feed_error_to_admin(feed, e, local_vars=locals())
            else:
                logging.debug(
예제 #2
0
     logging.error(tb)
     logging.debug('[%d] ! -------------------------' % (feed_id,))
     feed.save_page_history(550, "Page Error", tb)
     fetched_feed = None
     page_data = None
     # mail_feed_error_to_admin(feed, e, local_vars=locals())
     if (not settings.DEBUG and hasattr(settings, 'RAVEN_CLIENT') and
         settings.RAVEN_CLIENT):
         settings.RAVEN_CLIENT.captureException()
 
 feed = self.refresh_feed(feed.pk)
 logging.debug(u'   ---> [%-30s] ~FYFetching icon: %s' % (feed.title[:30], feed.feed_link))
 force = self.options['force']
 if random.random() > .99:
     force = True
 icon_importer = IconImporter(feed, page_data=page_data, force=force)
 try:
     icon_importer.save()
     icon_duration = time.time() - start_duration
 except TimeoutError, e:
     logging.debug('   ---> [%-30s] ~FRIcon fetch timed out...' % (feed.title[:30]))
     feed.save_page_history(556, 'Timeout', '')
 except Exception, e:
     logging.debug('[%d] ! -------------------------' % (feed_id,))
     tb = traceback.format_exc()
     logging.error(tb)
     logging.debug('[%d] ! -------------------------' % (feed_id,))
     # feed.save_feed_history(560, "Icon Error", tb)
     # mail_feed_error_to_admin(feed, e, local_vars=locals())
     if (not settings.DEBUG and hasattr(settings, 'RAVEN_CLIENT') and
         settings.RAVEN_CLIENT):
예제 #3
0
                                  (unicode(feed)[:30]))
                    feed.save_page_history(555, 'Timeout', '')
                except Exception, e:
                    logging.debug('[%d] ! -------------------------' %
                                  (feed_id, ))
                    tb = traceback.format_exc()
                    logging.error(tb)
                    logging.debug('[%d] ! -------------------------' %
                                  (feed_id, ))
                    ret_feed = FEED_ERREXC
                    feed.save_page_history(550, "Page Error", tb)
                    fetched_feed = None

                logging.debug(u'   ---> [%-30s] Fetching icon: %s' %
                              (unicode(feed)[:30], feed.feed_link))
                icon_importer = IconImporter(feed, force=self.options['force'])
                try:
                    icon_importer.save()
                except TimeoutError, e:
                    logging.debug('   ---> [%-30s] Icon fetch timed out...' %
                                  (unicode(feed)[:30]))
                    feed.save_page_history(556, 'Timeout', '')
                except Exception, e:
                    logging.debug('[%d] ! -------------------------' %
                                  (feed_id, ))
                    tb = traceback.format_exc()
                    logging.error(tb)
                    logging.debug('[%d] ! -------------------------' %
                                  (feed_id, ))
                    # feed.save_feed_history(560, "Icon Error", tb)
예제 #4
0
                                  (feed_id, ))
                    tb = traceback.format_exc()
                    logging.error(tb)
                    logging.debug('[%d] ! -------------------------' %
                                  (feed_id, ))
                    feed.save_page_history(550, "Page Error", tb)
                    fetched_feed = None
                    page_data = None
                    mail_feed_error_to_admin(feed, e, local_vars=locals())
                    settings.RAVEN_CLIENT.captureException()

                feed = self.refresh_feed(feed.pk)
                logging.debug(u'   ---> [%-30s] ~FYFetching icon: %s' %
                              (feed.title[:30], feed.feed_link))
                icon_importer = IconImporter(feed,
                                             page_data=page_data,
                                             force=self.options['force'])
                try:
                    icon_importer.save()
                    icon_duration = time.time() - start_duration
                except TimeoutError, e:
                    logging.debug(
                        '   ---> [%-30s] ~FRIcon fetch timed out...' %
                        (feed.title[:30]))
                    feed.save_page_history(556, 'Timeout', '')
                except Exception, e:
                    logging.debug('[%d] ! -------------------------' %
                                  (feed_id, ))
                    tb = traceback.format_exc()
                    logging.error(tb)
                    logging.debug('[%d] ! -------------------------' %