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
0cb51a34
Commit
0cb51a34
authored
5 years ago
by
Patrick Jentsch
Browse files
Options
Downloads
Patches
Plain Diff
Remove unnecessary job status
parent
0ea03983
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/models.py
+10
-5
10 additions, 5 deletions
app/models.py
app/services/views.py
+5
-5
5 additions, 5 deletions
app/services/views.py
with
15 additions
and
10 deletions
app/models.py
+
10
−
5
View file @
0cb51a34
...
@@ -322,11 +322,16 @@ class Job(db.Model):
...
@@ -322,11 +322,16 @@ class Job(db.Model):
"""
"""
Delete the job and its inputs and outputs from database and filesystem.
Delete the job and its inputs and outputs from database and filesystem.
"""
"""
self
.
status
=
'
stopping
'
if
self
.
status
!=
'
complete
'
and
self
.
status
!=
'
failed
'
:
db
.
session
.
commit
()
self
.
status
=
'
canceling
'
while
self
.
status
!=
'
deleted
'
:
db
.
session
.
commit
()
sleep
(
1
)
while
self
.
status
!=
'
canceled
'
:
db
.
session
.
refresh
(
self
)
# In case the daemon started a submitted job meanwhile
if
self
.
status
==
'
running
'
:
self
.
status
=
'
canceling
'
db
.
session
.
commit
()
sleep
(
1
)
db
.
session
.
refresh
(
self
)
path
=
os
.
path
.
join
(
current_app
.
config
[
'
NOPAQUE_STORAGE
'
],
path
=
os
.
path
.
join
(
current_app
.
config
[
'
NOPAQUE_STORAGE
'
],
str
(
self
.
user_id
),
'
jobs
'
,
str
(
self
.
id
))
str
(
self
.
user_id
),
'
jobs
'
,
str
(
self
.
id
))
try
:
try
:
...
...
This diff is collapsed.
Click to expand it.
app/services/views.py
+
5
−
5
View file @
0cb51a34
...
@@ -51,16 +51,16 @@ def service(service):
...
@@ -51,16 +51,16 @@ def service(service):
db
.
session
.
add
(
job
)
db
.
session
.
add
(
job
)
db
.
session
.
commit
()
db
.
session
.
commit
()
relative_dir
=
os
.
path
.
join
(
str
(
job
.
user_id
),
'
jobs
'
,
str
(
job
.
id
))
relative_dir
=
os
.
path
.
join
(
str
(
job
.
user_id
),
'
jobs
'
,
str
(
job
.
id
))
absolut_dir
=
os
.
path
.
join
(
absolut_dir
=
os
.
path
.
join
(
current_app
.
config
[
'
NOPAQUE_STORAGE
'
],
current_app
.
config
[
'
NOPAQUE_STORAGE
'
],
relative_dir
)
relative_dir
)
try
:
try
:
os
.
makedirs
(
absolut_dir
)
os
.
makedirs
(
absolut_dir
)
except
OSError
:
except
OSError
:
job
.
delete
()
job
.
delete
()
flash
(
'
Internal Server Error
'
)
flash
(
'
Internal Server Error
'
)
return
make_response
(
return
make_response
(
{
'
redirect_url
'
:
url_for
(
'
services.service
'
,
{
'
redirect_url
'
:
url_for
(
'
services.service
'
,
service
=
service
)},
service
=
service
)},
500
)
500
)
else
:
else
:
for
file
in
add_job_form
.
files
.
data
:
for
file
in
add_job_form
.
files
.
data
:
filename
=
secure_filename
(
file
.
filename
)
filename
=
secure_filename
(
file
.
filename
)
...
...
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