Skip to content

Commit a031ea5

Browse files
committed
implementing @effigies suggestions
1 parent bb11067 commit a031ea5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pydra/utils/hash.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,8 @@ def get_or_calculate_hash(self, key: CacheKey, calculate_hash: ty.Callable) -> H
129129
Returns
130130
-------
131131
Hash
132-
_description_
132+
the hash corresponding to the key, which is either retrieved from the persistent
133+
store or calculated using `calculate_hash` if not present
133134
"""
134135
try:
135136
return self._hashes[key]
@@ -141,6 +142,7 @@ def get_or_calculate_hash(self, key: CacheKey, calculate_hash: ty.Callable) -> H
141142
return Hash(key_path.read_bytes())
142143
hsh = calculate_hash()
143144
key_path.write_bytes(hsh)
145+
self._hashes[key] = Hash(hsh)
144146
return Hash(hsh)
145147

146148
def clean_up(self):

0 commit comments

Comments
 (0)