mirror of
https://github.com/viq/NewsBlur.git
synced 2025-09-18 21:43:31 +00:00
Correcting story limit in widget.
This commit is contained in:
parent
4df9858eb0
commit
99c4faaa79
1 changed files with 4 additions and 1 deletions
|
@ -1459,7 +1459,7 @@ def load_river_stories__redis(request):
|
|||
story_hashes = []
|
||||
unread_feed_story_hashes = []
|
||||
|
||||
mstories = MStory.objects(story_hash__in=story_hashes).order_by(story_date_order)
|
||||
mstories = MStory.objects(story_hash__in=story_hashes[:limit]).order_by(story_date_order)
|
||||
stories = Feed.format_stories(mstories)
|
||||
|
||||
found_feed_ids = list(set([story['story_feed_id'] for story in stories]))
|
||||
|
@ -1614,6 +1614,9 @@ def load_river_stories_widget(request):
|
|||
scontext.verify_mode = ssl.VerifyMode.CERT_NONE
|
||||
try:
|
||||
conn = urllib.request.urlopen(url, context=scontext, timeout=timeout)
|
||||
except urllib.request.URLError:
|
||||
url = url.replace('localhost', 'haproxy')
|
||||
conn = urllib.request.urlopen(url, context=scontext, timeout=timeout)
|
||||
except socket.timeout:
|
||||
logging.user(request.user, '"%s" not fetched in %ss' % (url, (time.time() - start)))
|
||||
return None
|
||||
|
|
Loading…
Add table
Reference in a new issue