Skip to content

Commit

Permalink
delete jel and day dir if empty (#398)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsschult authored Oct 26, 2024
1 parent 4340334 commit 667d7a2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
18 changes: 8 additions & 10 deletions iceprod/server/plugins/condor.py
Original file line number Diff line number Diff line change
Expand Up @@ -930,15 +930,13 @@ async def check_submit_dir(self):
logger.info('cleaning up submit dir %s', path)
shutil.rmtree(path)
if empty:
st = daydir.lstat()
if st.st_mtime < dir_old_time:
logger.info('cleaning up daydir %s', daydir)
for path in self.jels.copy():
if Path(path).parent == daydir:
logger.info('removing JEL')
self.jels[path].close()
del self.jels[path]
shutil.rmtree(daydir)
continue
logger.info('cleaning up daydir %s', daydir)
for path in self.jels.copy():
if Path(path).parent == daydir:
logger.info('removing JEL')
self.jels[path].close()
del self.jels[path]
shutil.rmtree(daydir)
continue
# let other processing happen
await asyncio.sleep(0)
4 changes: 1 addition & 3 deletions tests/server/plugins/condor_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -622,9 +622,7 @@ async def test_Grid_check_delete_day(schedd, i3prod_path, set_time):

jel = g.get_current_JEL()
p = jel.parent
t = time.mktime(set_time.utctimetuple()) - 35 # must be older than all times added together
os.utime(p, (t, t))
logging.info('set time to %d', t)
t = time.mktime(set_time.utctimetuple())

assert g.jels != {}

Expand Down

0 comments on commit 667d7a2

Please sign in to comment.