Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
john-science authored Nov 26, 2024
1 parent cbc0462 commit 09d4319
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion armi/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -847,6 +847,7 @@ def safeMove(src: str, dst: str) -> None:

srcSize = os.path.getsize(src)
if "win" in sys.platform:
# this covers Windows ("win32") and MacOS ("darwin")
shutil.move(src, dst)
elif "linux" in sys.platform:
cmd = f'mv "{src}" "{dst}"'
Expand All @@ -856,6 +857,7 @@ def safeMove(src: str, dst: str) -> None:
"Cannot perform ``safeMove`` on files because ARMI only supports "
+ "Linux, MacOS, and Windows."
)

waitTime = 0.01 # 10 ms
maxWaitTime = 6000 # 1 min
totalWaitTime = 0
Expand All @@ -873,7 +875,7 @@ def safeMove(src: str, dst: str) -> None:
f"File move from {dst} to {src} has failed due to exceeding "
+ f"a maximum wait time of {maxWaitTime/60} minutes."
)
break
return

runLog.extra("Moved {} -> {}".format(src, dst))
return dst
Expand Down

0 comments on commit 09d4319

Please sign in to comment.