Skip to content

Commit e0baf72

Browse files
Clarify missing usage handling
Signed-off-by: Samuel Williams <samuel.williams@shopify.com> Assisted-By: devx/618580b0-d55f-4c2e-95b6-87e648f60543
1 parent 2d56070 commit e0baf72

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎lib/async/pool/controller.rb‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,9 @@ def acquire
166166

167167
# Make the resource resources and let waiting tasks know that there is something resources.
168168
def release(resource)
169-
usage = decrement_usage(resource)
170-
return false unless usage
169+
unless usage = decrement_usage(resource)
170+
return false
171+
end
171172

172173
if resource.reusable?
173174
# If the resource was fully utilized, it now becomes available:

0 commit comments

Comments
 (0)