Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
joein committed Nov 12, 2024
1 parent 9e33409 commit c5b100f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,21 @@ def last_resort(func, path, exc_info):

import sys

def get_size(path: Path) -> int:
if path.is_file():
return path.stat().st_size
elif path.is_dir():
# Sum up the sizes of all files in the directory
return sum(f.stat().st_size for f in path.rglob("*") if f.is_file())
return 0

try:
print(sys.getwindowsversion())
path = Path("C:/Users/RUNNER~1/AppData/Local/Temp/fastembed_cache/")
if path.exists():
for path in path.rglob("*"):
print(path)
size = get_size(path)
print(f"{path}: {size / (1024 * 1024):.2f} MB")
except Exception:
print("Not windows")

0 comments on commit c5b100f

Please sign in to comment.