Skip to content

Commit

Permalink
fix: do not delete the logs folder when the database is not empty
Browse files Browse the repository at this point in the history
It can happen that the logs folder is empty (all jobs are pending) but the database is not empty. We should not delete the logs folder in this case.
  • Loading branch information
183amir authored Jul 17, 2024
1 parent 731380b commit 1e8c607
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gridtk/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,6 @@ def __del__(self):
and len(self.list_jobs(update_jobs=False)) == 0
):
Path(self.database).unlink()
if self.logs_dir.exists() and len(os.listdir(self.logs_dir)) == 0:
shutil.rmtree(self.logs_dir)
if self.logs_dir.exists() and len(os.listdir(self.logs_dir)) == 0:
shutil.rmtree(self.logs_dir)
self.engine.dispose()

0 comments on commit 1e8c607

Please sign in to comment.