Skip to content

Logs: always log documentation size in megabytes #10812

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

Merged
merged 2 commits into from
Oct 10, 2023
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
8 changes: 4 additions & 4 deletions readthedocs/projects/tasks/builds.py
Original file line number Diff line number Diff line change
Expand Up @@ -964,14 +964,14 @@ def store_build_artifacts(self):
def _log_directory_size(self, directory, media_type):
try:
output = subprocess.check_output(
["du", "--summarize", "--human-readable", "--", directory]
["du", "--summarize", "-m", "--", directory]
)
# The output is something like: "1.2M\t/path/to/directory".
directory_size = output.decode().split()[0]
# The output is something like: "5\t/path/to/directory".
directory_size = int(output.decode().split()[0])
log.info(
"Build artifacts directory size.",
directory=directory,
size=directory_size,
size=directory_size, # Size in mega bytes
media_type=media_type,
)
except Exception:
Expand Down