Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SSHOC
data-ingestion
Commits
06efad85
Commit
06efad85
authored
Mar 18, 2022
by
Seungbin Yim
Browse files
Log TooManyRedirects Exception
parent
d14c92b0
Changes
1
Hide whitespace changes
Inline
Side-by-side
repositories/extraction/publication_retrieval/src/publication_tool_extractor.py
View file @
06efad85
...
...
@@ -12,7 +12,7 @@ from itertools import filterfalse
from
datetime
import
datetime
,
timezone
from
model.sshoc_tool
import
SshocItem
,
SshocPublication
from
openapi_client
import
*
from
requests.exceptions
import
HTTPError
,
ConnectionError
from
requests.exceptions
import
HTTPError
,
ConnectionError
,
TooManyRedirects
from
rest.rest_client
import
RestClient
from
rest.sshoc_adapter
import
SshocAdapter
,
SshocVocabulary
from
bs4
import
BeautifulSoup
...
...
@@ -196,6 +196,10 @@ class SshocToolCandidateExtractor(object):
with
open
(
'logs/pub_download_connectionerror.log'
,
'a+'
)
as
fne_log
:
fne_log
.
write
(
link
+
'
\n
'
)
self
.
logger
.
debug
(
'ConnectionError while downloading to publication source:'
+
link
)
except
TooManyRedirects
:
with
open
(
'logs/pub_download_connectionerror.log'
,
'a+'
)
as
tmr_log
:
tmr_log
.
write
(
link
+
'
\n
'
)
self
.
logger
.
debug
(
'TooManyRedirects: '
+
link
)
self
.
logger
.
info
(
"Total number of XML Links: "
+
str
(
xml_count
))
self
.
logger
.
info
(
"PDF download completed.."
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment