Skip to content

Commit

Permalink
Automatic style fix
Browse files Browse the repository at this point in the history
  • Loading branch information
robot-clickhouse committed Oct 26, 2024
1 parent 92b13c5 commit 0f25890
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions ci/praktika/digest.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ def calc_job_digest(self, job_config: Job.Config):
sorted=True,
)

print(f"calc digest for job [{job_config.name}]: hash_key [{cache_key}], include [{len(included_files)}] files")
print(
f"calc digest for job [{job_config.name}]: hash_key [{cache_key}], include [{len(included_files)}] files"
)
# Sort files to ensure consistent hash calculation
included_files.sort()

Expand Down Expand Up @@ -98,8 +100,10 @@ def _calc_file_digest(file_path, hash_md5):
if Path(file_path).is_symlink():
resolved_path = os.path.realpath(file_path)
if not Path(resolved_path).is_file():
print(f"WARNING: No valid file resolved by link {file_path} -> {resolved_path} - skipping digest calculation")
return hash_md5.hexdigest()[:Settings.CACHE_DIGEST_LEN]
print(
f"WARNING: No valid file resolved by link {file_path} -> {resolved_path} - skipping digest calculation"
)
return hash_md5.hexdigest()[: Settings.CACHE_DIGEST_LEN]

with open(resolved_path, "rb") as f:
for chunk in iter(lambda: f.read(4096), b""):
Expand Down

0 comments on commit 0f25890

Please sign in to comment.