mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
Icon importer also uses new consul domain.
This commit is contained in:
parent
78f2599e59
commit
8c226b55d3
1 changed files with 27 additions and 22 deletions
|
@ -1,33 +1,36 @@
|
||||||
import urllib.request
|
import base64
|
||||||
|
import datetime
|
||||||
|
import gzip
|
||||||
|
import http.client
|
||||||
|
import operator
|
||||||
|
import struct
|
||||||
import urllib.error
|
import urllib.error
|
||||||
import urllib.parse
|
import urllib.parse
|
||||||
|
import urllib.request
|
||||||
|
from io import BytesIO
|
||||||
|
from socket import error as SocketError
|
||||||
|
|
||||||
|
import boto3
|
||||||
import lxml.html
|
import lxml.html
|
||||||
import numpy
|
import numpy
|
||||||
import scipy
|
|
||||||
import scipy.misc
|
|
||||||
import scipy.cluster
|
|
||||||
import struct
|
|
||||||
import operator
|
|
||||||
import gzip
|
|
||||||
import datetime
|
|
||||||
import requests
|
import requests
|
||||||
import base64
|
import scipy
|
||||||
import http.client
|
import scipy.cluster
|
||||||
from PIL import BmpImagePlugin, PngImagePlugin, Image
|
import scipy.misc
|
||||||
from socket import error as SocketError
|
|
||||||
import boto3
|
|
||||||
from io import BytesIO
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.http import HttpResponse
|
|
||||||
from django.contrib.sites.models import Site
|
from django.contrib.sites.models import Site
|
||||||
from apps.rss_feeds.models import MFeedPage, MFeedIcon
|
from django.http import HttpResponse
|
||||||
from utils.facebook_fetcher import FacebookFetcher
|
from OpenSSL.SSL import SESS_CACHE_NO_INTERNAL_STORE
|
||||||
from utils import log as logging
|
from OpenSSL.SSL import Error as OpenSSLError
|
||||||
from utils.feed_functions import timelimit, TimeoutError
|
from PIL import BmpImagePlugin, Image, PngImagePlugin
|
||||||
from OpenSSL.SSL import Error as OpenSSLError, SESS_CACHE_NO_INTERNAL_STORE
|
|
||||||
from pyasn1.error import PyAsn1Error
|
from pyasn1.error import PyAsn1Error
|
||||||
from requests.packages.urllib3.exceptions import LocationParseError
|
from requests.packages.urllib3.exceptions import LocationParseError
|
||||||
|
|
||||||
|
from apps.rss_feeds.models import MFeedIcon, MFeedPage
|
||||||
|
from utils import log as logging
|
||||||
|
from utils.facebook_fetcher import FacebookFetcher
|
||||||
|
from utils.feed_functions import TimeoutError, timelimit
|
||||||
|
|
||||||
|
|
||||||
class IconImporter(object):
|
class IconImporter(object):
|
||||||
|
|
||||||
|
@ -206,8 +209,10 @@ class IconImporter(object):
|
||||||
if self.page_data:
|
if self.page_data:
|
||||||
content = self.page_data
|
content = self.page_data
|
||||||
elif settings.BACKED_BY_AWS.get('pages_on_node'):
|
elif settings.BACKED_BY_AWS.get('pages_on_node'):
|
||||||
domain = Site.objects.get_current().domain
|
domain = "node-page.service.consul:8008"
|
||||||
url = "https://%s/original_page/%s" % (
|
if settings.DOCKERBUILD:
|
||||||
|
domain = "node:8008"
|
||||||
|
url = "http://%s/original_page/%s" % (
|
||||||
domain,
|
domain,
|
||||||
self.feed.pk,
|
self.feed.pk,
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Reference in a new issue