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

ignore more FileNotFoundErrors #702

Merged
Merged
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
16 changes: 8 additions & 8 deletions src/plotman/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,14 +377,14 @@ def get_mem_usage(self):

def get_tmp_usage(self):
total_bytes = 0
with os.scandir(self.tmpdir) as it:
for entry in it:
if self.plot_id in entry.name:
try:
total_bytes += entry.stat().st_size
except FileNotFoundError:
# The file might disappear; this being an estimate we don't care
pass
with contextlib.suppress(FileNotFoundError):
# The directory might not exist at this name, or at all, anymore
with os.scandir(self.tmpdir) as it:
for entry in it:
if self.plot_id in entry.name:
with contextlib.suppress(FileNotFoundError):
# The file might disappear; this being an estimate we don't care
total_bytes += entry.stat().st_size
return total_bytes

def get_run_status(self):
Expand Down