Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
genotoul-bioinfo
D-GENIES
Commits
5bbcba48
Commit
5bbcba48
authored
Feb 21, 2018
by
Floreal Cabanettes
Browse files
Fix clean jobs
parent
176ad29a
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/dgenies/bin/clean_jobs.py
View file @
5bbcba48
...
...
@@ -47,15 +47,16 @@ def parse_database(app_data, max_age, fake=False):
is_gallery
=
len
(
Gallery
.
select
().
join
(
Job
).
where
(
Job
.
id_job
==
id_job
))
>
0
if
is_gallery
:
gallery_jobs
.
append
(
id_job
)
print
(
"Removing job %s..."
%
id_job
)
data_dir
=
os
.
path
.
join
(
app_data
,
id_job
)
if
os
.
path
.
exists
(
data_dir
)
and
os
.
path
.
isdir
(
data_dir
):
if
not
fake
:
shutil
.
rmtree
(
data_dir
)
else
:
print
(
"Job %s has no data folder!"
%
id_job
)
if
not
fake
:
job
.
delete_instance
()
print
(
"Removing job %s..."
%
id_job
)
data_dir
=
os
.
path
.
join
(
app_data
,
id_job
)
if
os
.
path
.
exists
(
data_dir
)
and
os
.
path
.
isdir
(
data_dir
):
if
not
fake
:
shutil
.
rmtree
(
data_dir
)
else
:
print
(
"Job %s has no data folder!"
%
id_job
)
if
not
fake
:
job
.
delete_instance
()
return
gallery_jobs
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment