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
f2a5fe31
Commit
f2a5fe31
authored
3 years ago
by
Patrick Jentsch
Browse files
Options
Downloads
Patches
Plain Diff
Make Jobs restartable when they are "complete"
parent
f4233093
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
web/app/jobs/views.py
+2
-2
2 additions, 2 deletions
web/app/jobs/views.py
web/app/models.py
+3
-3
3 additions, 3 deletions
web/app/models.py
with
5 additions
and
5 deletions
web/app/jobs/views.py
+
2
−
2
View file @
f2a5fe31
...
...
@@ -47,8 +47,8 @@ def download_job_input(job_id, job_input_id):
@admin_required
def
restart
(
job_id
):
job
=
Job
.
query
.
get_or_404
(
job_id
)
if
job
.
status
!=
'
failed
'
:
flash
(
'
Can not restart job
"
{}
"
: Status is not
"
failed
"'
.
format
(
job
.
title
),
'
error
'
)
# noqa
if
job
.
status
not
in
[
'
complete
'
,
'
failed
'
]
:
flash
(
'
Can not restart job
"
{}
"
: Status is not
"
complete/
failed
"'
.
format
(
job
.
title
),
'
error
'
)
# noqa
else
:
tasks
.
restart_job
(
job_id
)
flash
(
'
Job
"
{}
"
has been marked to get restarted!
'
.
format
(
job
.
title
),
'
job
'
)
# noqa
...
...
This diff is collapsed.
Click to expand it.
web/app/models.py
+
3
−
3
View file @
f2a5fe31
...
...
@@ -410,11 +410,11 @@ class Job(db.Model):
def
restart
(
self
):
'''
Restart a job - only if the status is failed
Restart a job - only if the status is
complete or
failed
'''
if
self
.
status
!=
'
failed
'
:
raise
Exception
(
'
Could not restart job: status is not
"
failed
"'
)
if
self
.
status
not
in
[
'
complete
'
,
'
failed
'
]
:
raise
Exception
(
'
Could not restart job: status is not
"
complete/
failed
"'
)
# noqa
shutil
.
rmtree
(
os
.
path
.
join
(
self
.
path
,
'
output
'
),
ignore_errors
=
True
)
shutil
.
rmtree
(
os
.
path
.
join
(
self
.
path
,
'
pyflow.data
'
),
ignore_errors
=
True
)
# noqa
self
.
end_date
=
None
...
...
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