Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
humanities
gargantext
Commits
86bf928f
Commit
86bf928f
authored
Jan 21, 2016
by
delanoe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] sessions + default nb of documents for scrapping.
parent
c331b01a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
15 deletions
+18
-15
celery.py
gargantext_web/celery.py
+6
-4
db.py
gargantext_web/db.py
+7
-7
views.py
scrappers/scrap_pubmed/views.py
+2
-1
project.html
templates/project.html
+3
-3
No files found.
gargantext_web/celery.py
View file @
86bf928f
...
@@ -47,13 +47,15 @@ def apply_workflow(corpus_id):
...
@@ -47,13 +47,15 @@ def apply_workflow(corpus_id):
print
(
"End of the Workflow for corpus
%
d"
%
(
corpus_id
))
print
(
"End of the Workflow for corpus
%
d"
%
(
corpus_id
))
update_state
.
processing_
(
int
(
corpus_id
),
"0"
)
update_state
.
processing_
(
int
(
corpus_id
),
"0"
)
mysession
.
close
()
#mysession.close()
get_session
.
remove
()
#get_session.remove()
mysession
.
remove
()
except
Exception
as
error
:
except
Exception
as
error
:
print
(
error
)
print
(
error
)
PrintException
()
PrintException
()
mysession
.
close
()
#mysession.close()
get_session
.
remove
()
#get_session.remove()
mysession
.
remove
()
@
shared_task
@
shared_task
def
empty_trash
(
corpus_id
):
def
empty_trash
(
corpus_id
):
...
...
gargantext_web/db.py
View file @
86bf928f
...
@@ -131,24 +131,24 @@ def literalquery(statement, dialect=None):
...
@@ -131,24 +131,24 @@ def literalquery(statement, dialect=None):
return
LiteralCompiler
(
dialect
,
statement
)
return
LiteralCompiler
(
dialect
,
statement
)
#
def
get_sessionmaker
():
def
get_sessionmaker
():
from
sqlalchemy.orm
import
sessionmaker
from
sqlalchemy.orm
import
sessionmaker
return
sessionmaker
(
bind
=
engine
)
return
sessionmaker
(
bind
=
engine
)
#
def get_session():
def
get_session
():
#
session_factory = get_sessionmaker()
session_factory
=
get_sessionmaker
()
#
return scoped_session(session_factory)
return
scoped_session
(
session_factory
)
# get_session à importer, plus pratique pour les remove
# get_session à importer, plus pratique pour les remove
session_factory
=
get_sessionmaker
()
#
session_factory = get_sessionmaker()
get_session
=
scoped_session
(
session_factory
)
#
get_session = scoped_session(session_factory)
# the global session ------------
# the global session ------------
# pour les modules qui importent
# pour les modules qui importent
# directement session
# directement session
session
=
get_session
()
session
=
get_session
()
()
# -------------------------------
# -------------------------------
...
...
scrappers/scrap_pubmed/views.py
View file @
86bf928f
...
@@ -46,7 +46,8 @@ def getGlobalStats(request ):
...
@@ -46,7 +46,8 @@ def getGlobalStats(request ):
alist
=
[
"bar"
,
"foo"
]
alist
=
[
"bar"
,
"foo"
]
if
request
.
method
==
"POST"
:
if
request
.
method
==
"POST"
:
N
=
1000
#N = 1000
N
=
300
query
=
request
.
POST
[
"query"
]
query
=
request
.
POST
[
"query"
]
print
(
"LOG::TIME:_ "
+
datetime
.
datetime
.
now
()
.
isoformat
()
+
" query ="
,
query
)
print
(
"LOG::TIME:_ "
+
datetime
.
datetime
.
now
()
.
isoformat
()
+
" query ="
,
query
)
print
(
"LOG::TIME:_ "
+
datetime
.
datetime
.
now
()
.
isoformat
()
+
" N ="
,
N
)
print
(
"LOG::TIME:_ "
+
datetime
.
datetime
.
now
()
.
isoformat
()
+
" N ="
,
N
)
...
...
templates/project.html
View file @
86bf928f
...
@@ -299,7 +299,7 @@
...
@@ -299,7 +299,7 @@
var
origQuery
=
$
(
"#id_name"
).
val
()
var
origQuery
=
$
(
"#id_name"
).
val
()
console
.
log
(
"printing the results:"
)
console
.
log
(
"printing the results:"
)
console
.
log
(
origQuery
)
console
.
log
(
origQuery
)
testISTEX
(
origQuery
.
replace
(
" "
,
"+"
),
10
00
)
testISTEX
(
origQuery
.
replace
(
" "
,
"+"
),
3
00
)
}
}
}
}
else
{
else
{
...
@@ -349,7 +349,7 @@
...
@@ -349,7 +349,7 @@
console
.
log
(
"enabling "
+
"#"
+
value
.
id
)
console
.
log
(
"enabling "
+
"#"
+
value
.
id
)
$
(
"#"
+
value
.
id
).
attr
(
'onclick'
,
'getGlobalResults(this);'
);
$
(
"#"
+
value
.
id
).
attr
(
'onclick'
,
'getGlobalResults(this);'
);
// $("#submit_thing").prop('disabled' , false)
// $("#submit_thing").prop('disabled' , false)
$
(
"#submit_thing"
).
html
(
"Process a
10
00 sample!"
)
$
(
"#submit_thing"
).
html
(
"Process a
3
00 sample!"
)
thequeries
=
data
thequeries
=
data
var
N
=
0
,
k
=
0
;
var
N
=
0
,
k
=
0
;
...
@@ -388,7 +388,7 @@
...
@@ -388,7 +388,7 @@
console
.
log
(
"enabling "
+
"#"
+
value
.
id
)
console
.
log
(
"enabling "
+
"#"
+
value
.
id
)
$
(
"#"
+
value
.
id
).
attr
(
'onclick'
,
'getGlobalResults(this);'
);
$
(
"#"
+
value
.
id
).
attr
(
'onclick'
,
'getGlobalResults(this);'
);
// $("#submit_thing").prop('disabled' , false)
// $("#submit_thing").prop('disabled' , false)
$
(
"#submit_thing"
).
html
(
"Process a
10
00 sample!"
)
$
(
"#submit_thing"
).
html
(
"Process a
3
00 sample!"
)
thequeries
=
data
thequeries
=
data
var
N
=
data
.
length
,
k
=
0
;
var
N
=
data
.
length
,
k
=
0
;
...
...
Write
Preview
Markdown
is supported
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