Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

delete jel and day dir if empty #398

Merged
merged 1 commit into from
Oct 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading