mirror of
https://github.com/viq/NewsBlur.git
synced 2025-09-18 21:43:31 +00:00
Fixing invalid feed tags.
This commit is contained in:
parent
0deb0aff2f
commit
389157e2f0
1 changed files with 6 additions and 3 deletions
|
@ -82,6 +82,9 @@ class Feed(models.Model):
|
|||
if status_code >= 400:
|
||||
fetch_history = self.feed_fetch_history.all().values('status_code')
|
||||
self.count_errors_in_history(fetch_history)
|
||||
elif self.has_exception:
|
||||
self.has_exception = False
|
||||
self.save()
|
||||
|
||||
def save_page_history(self, status_code, message, exception=None):
|
||||
PageFetchHistory.objects.create(feed=self,
|
||||
|
@ -95,6 +98,9 @@ class Feed(models.Model):
|
|||
if status_code >= 400:
|
||||
fetch_history = self.page_fetch_history.all().values('status_code')
|
||||
self.count_errors_in_history(fetch_history)
|
||||
elif self.has_exception:
|
||||
self.has_exception = False
|
||||
self.save()
|
||||
|
||||
def count_errors_in_history(self, fetch_history):
|
||||
non_errors = [h for h in fetch_history if int(h['status_code']) < 400]
|
||||
|
@ -104,9 +110,6 @@ class Feed(models.Model):
|
|||
self.has_exception = True
|
||||
self.active = False
|
||||
self.save()
|
||||
elif self.has_exception:
|
||||
self.has_exception = False
|
||||
self.save()
|
||||
|
||||
def count_subscribers(self, verbose=False, lock=None):
|
||||
from apps.reader.models import UserSubscription
|
||||
|
|
Loading…
Add table
Reference in a new issue