Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
nopaque
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SFB 1288 - INF
nopaque
Commits
3d8d2b3e
Commit
3d8d2b3e
authored
5 years ago
by
Patrick Jentsch
Browse files
Options
Downloads
Patches
Plain Diff
Codestyle update
parent
dd469386
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/__init__.py
+1
-1
1 addition, 1 deletion
app/__init__.py
app/corpora/events.py
+2
-4
2 additions, 4 deletions
app/corpora/events.py
app/services/views.py
+2
-2
2 additions, 2 deletions
app/services/views.py
with
5 additions
and
7 deletions
app/__init__.py
+
1
−
1
View file @
3d8d2b3e
...
...
@@ -23,7 +23,7 @@ def create_app(config_name):
db
.
init_app
(
app
)
login_manager
.
init_app
(
app
)
mail
.
init_app
(
app
)
socketio
.
init_app
(
app
,
message_qeue
=
'
redis://
'
)
socketio
.
init_app
(
app
,
message_qeue
=
'
redis://
redis
'
)
from
.
import
events
...
...
This diff is collapsed.
Click to expand it.
app/corpora/events.py
+
2
−
4
View file @
3d8d2b3e
...
...
@@ -72,7 +72,6 @@ def corpus_analysis(message):
def
corpus_analysis_session_handler
(
app
,
corpus_id
,
session_id
):
with
app
.
app_context
():
'''
Setup analysis session
'''
logger
.
warning
(
'
[{}] Setup analysis session
'
.
format
(
session_id
))
corpus
=
Corpus
.
query
.
get
(
corpus_id
)
while
corpus
.
status
!=
'
analysing
'
:
db
.
session
.
refresh
(
corpus
)
...
...
@@ -84,13 +83,12 @@ def corpus_analysis_session_handler(app, corpus_id, session_id):
corpus_analysis_sessions
[
corpus_id
]
=
[
session_id
]
else
:
corpus_analysis_sessions
[
corpus_id
].
append
(
session_id
)
socketio
.
emit
(
'
request_corpus_analysis
'
,
'
[201]: Created
'
,
room
=
session_id
)
socketio
.
emit
(
'
request_corpus_analysis
'
,
'
[201]: Created
'
,
room
=
session_id
)
'''
Observe analysis session
'''
while
session_id
in
connected_sessions
:
logger
.
warning
(
'
[{}] Observe analysis session
'
.
format
(
session_id
))
socketio
.
sleep
(
3
)
'''
Teardown analysis session
'''
logger
.
warning
(
'
[{}] Teardown analysis session
'
.
format
(
session_id
))
client
.
disconnect
()
corpus_analysis_clients
.
pop
(
session_id
,
None
)
corpus_analysis_sessions
[
corpus_id
].
remove
(
session_id
)
...
...
This diff is collapsed.
Click to expand it.
app/services/views.py
+
2
−
2
View file @
3d8d2b3e
from
app
import
db
,
logger
from
app
import
db
from
app.jobs.forms
import
AddNLPJobForm
,
AddOCRJobForm
from
app.models
import
Job
,
JobInput
from
flask
import
(
abort
,
current_app
,
flash
,
make_response
,
render_template
,
request
,
url_for
)
url_for
)
from
flask_login
import
current_user
,
login_required
from
werkzeug.utils
import
secure_filename
from
.
import
services
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment