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
Admin message
Looking for advice? Join the
Matrix channel for GitLab users in Bielefeld
!
Show more breadcrumbs
SFB 1288 - INF
nopaque
Commits
96db5c1e
Commit
96db5c1e
authored
5 years ago
by
Stephan Porada
Browse files
Options
Downloads
Plain Diff
Merge branch 'development' of gitlab.ub.uni-bielefeld.de:sfb1288inf/opaque into development
parents
0ca4bf60
9a475f2a
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/models.py
+14
-27
14 additions, 27 deletions
app/models.py
app/static/js/add_job.js
+1
-0
1 addition, 0 deletions
app/static/js/add_job.js
with
15 additions
and
27 deletions
app/models.py
+
14
−
27
View file @
96db5c1e
...
@@ -2,6 +2,7 @@ from datetime import datetime
...
@@ -2,6 +2,7 @@ from datetime import datetime
from
flask
import
current_app
from
flask
import
current_app
from
flask_login
import
UserMixin
,
AnonymousUserMixin
from
flask_login
import
UserMixin
,
AnonymousUserMixin
from
itsdangerous
import
BadSignature
,
TimedJSONWebSignatureSerializer
from
itsdangerous
import
BadSignature
,
TimedJSONWebSignatureSerializer
from
time
import
sleep
from
werkzeug.security
import
generate_password_hash
,
check_password_hash
from
werkzeug.security
import
generate_password_hash
,
check_password_hash
from
.
import
db
,
logger
,
login_manager
from
.
import
db
,
logger
,
login_manager
import
os
import
os
...
@@ -330,23 +331,16 @@ class Job(db.Model):
...
@@ -330,23 +331,16 @@ class Job(db.Model):
self
.
status
=
'
stopping
'
self
.
status
=
'
stopping
'
db
.
session
.
commit
()
db
.
session
.
commit
()
while
self
.
status
!=
'
deleted
'
:
while
self
.
status
!=
'
deleted
'
:
'''
TODO: wait a second
'''
sleep
(
1
)
db
.
session
.
refresh
(
self
)
db
.
session
.
refresh
(
self
)
path
=
os
.
path
.
join
(
current_app
.
config
[
'
OPAQUE_STORAGE_DIRECTORY
'
],
path
=
os
.
path
.
join
(
current_app
.
config
[
'
OPAQUE_STORAGE_DIRECTORY
'
],
str
(
self
.
user_id
),
'
jobs
'
,
str
(
self
.
id
))
str
(
self
.
user_id
),
'
jobs
'
,
str
(
self
.
id
))
'''
try
:
'
TODO: Remove this workaround by executing the following command
shutil
.
rmtree
(
path
)
'
before service removal.
except
Exception
as
e
:
'
'''
TODO: Proper exception handling
'''
'
docker service update --mount-rm <service>
logger
.
warning
(
e
)
'''
pass
while
os
.
path
.
exists
(
path
):
try
:
shutil
.
rmtree
(
path
)
except
Exception
as
e
:
'''
TODO: Proper exception handling
'''
logger
.
warning
(
e
)
pass
db
.
session
.
delete
(
self
)
db
.
session
.
delete
(
self
)
db
.
session
.
commit
()
db
.
session
.
commit
()
...
@@ -445,19 +439,12 @@ class Corpus(db.Model):
...
@@ -445,19 +439,12 @@ class Corpus(db.Model):
corpus_file
.
delete
()
corpus_file
.
delete
()
path
=
os
.
path
.
join
(
current_app
.
config
[
'
OPAQUE_STORAGE_DIRECTORY
'
],
path
=
os
.
path
.
join
(
current_app
.
config
[
'
OPAQUE_STORAGE_DIRECTORY
'
],
str
(
self
.
user_id
),
'
corpora
'
,
str
(
self
.
id
))
str
(
self
.
user_id
),
'
corpora
'
,
str
(
self
.
id
))
'''
try
:
'
TODO: Remove this workaround by executing the following command
shutil
.
rmtree
(
path
)
'
before service removal.
except
Exception
as
e
:
'
'''
TODO: Proper exception handling
'''
'
docker service update --mount-rm <service>
logger
.
warning
(
e
)
'''
pass
while
os
.
path
.
exists
(
path
):
try
:
shutil
.
rmtree
(
path
)
except
Exception
as
e
:
'''
TODO: Proper exception handling
'''
logger
.
warning
(
e
)
pass
db
.
session
.
delete
(
self
)
db
.
session
.
delete
(
self
)
db
.
session
.
commit
()
db
.
session
.
commit
()
...
...
This diff is collapsed.
Click to expand it.
app/static/js/add_job.js
+
1
−
0
View file @
96db5c1e
...
@@ -19,6 +19,7 @@ function SubmitAddJobForm(newJobFormElement, progressModalElement, request) {
...
@@ -19,6 +19,7 @@ function SubmitAddJobForm(newJobFormElement, progressModalElement, request) {
}
}
if
(
request
.
status
===
400
)
{
if
(
request
.
status
===
400
)
{
console
.
log
(
JSON
.
parse
(
this
.
responseText
));
console
.
log
(
JSON
.
parse
(
this
.
responseText
));
// TODO print errors under input fields.
}
}
if
(
request
.
status
===
500
)
{
if
(
request
.
status
===
500
)
{
location
.
reload
();
location
.
reload
();
...
...
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