Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
sefarad
gsicrawler
Commits
e45c98f8
Commit
e45c98f8
authored
Feb 01, 2018
by
Alberto Pascual
Browse files
elasticsearch timeout fix
parent
cba25ec0
Changes
1
Hide whitespace changes
Inline
Side-by-side
analysistask.py
View file @
e45c98f8
...
...
@@ -111,8 +111,11 @@ class AnalysisTask(luigi.Task):
with
self
.
output
().
open
(
'w'
)
as
output
:
with
self
.
input
().
open
(
'r'
)
as
infile
:
for
line
in
infile
:
lines
=
sum
(
1
for
_
in
infile
)
for
j
,
line
in
enumerate
(
infile
):
i
=
json
.
loads
(
line
)
progress
=
(
j
*
100
)
/
lines
self
.
set_status_message
(
"Progress %d%"
%
progress
)
i
=
semanticAnalysis
(
i
)
output
.
write
(
json
.
dumps
(
i
))
output
.
write
(
'
\n
'
)
...
...
@@ -218,6 +221,8 @@ class Elasticsearch(CopyToIndex):
host
=
ES_ENDPOINT
#: the port used by the ElasticSearch service.
port
=
ES_PORT
#: timeout for ES post
timeout
=
100
print
(
host
,
port
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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