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

bc_clean_old_dirs also cleanup db files #3860

Closed
stdweird opened this issue Oct 8, 2024 · 3 comments
Closed

bc_clean_old_dirs also cleanup db files #3860

stdweird opened this issue Oct 8, 2024 · 3 comments
Milestone

Comments

@stdweird
Copy link

stdweird commented Oct 8, 2024

bc_clean_old_dirs now cleans up session output dirs that are certain age; but can it be extended to cleanup also files in the db dir, eg ~/ondemand/data/sys/dashboard/batch_connect/db ? we have some users who have files there that are very very old, and reference clusters that are no longer around. afaik, these files are one per job; so shouldn't be older then max job age (but we are fine if they are cleaned eg together with the bc_clean_old_dirs logic

@osc-bot osc-bot added this to the Backlog milestone Oct 8, 2024
@johrstrom
Copy link
Contributor

These files do get cleaned up after so long (7 days after it's completed is the default).

Maybe it's a case of backward comparability? Like we started to clean these files, but never cleaned the files from previous versions?

@stdweird
Copy link
Author

stdweird commented Oct 8, 2024

@johrstrom that's possible. the old files i found were from our 2.0.X setup (and over 9 months old); but that means they were also not cleaned up by 2.0 (not sure when the cleanup was added). anyway, i will try to cleanup as much as possible; and will reopen this when i see files from 3.1 era not being cleaned up.

@stdweird stdweird closed this as completed Oct 8, 2024
@johrstrom
Copy link
Contributor

To be clear - here's the logic to delete them if they're old. I feel like it was added in 2.0, but would have to check to be sure.

(s.completed? && s.old? && s.destroy) ? nil : s

It would seem that modified_at isn't available, so it's thinking that the cards are not in fact old enough to delete.

def old?
if modified_at.nil?
false
else
modified_at < self.class.old_in_days.days.ago.to_i
end
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants