mirror of
https://gitea.invidious.io/iv-org/shard-crystal-db.git
synced 2024-08-15 00:53:32 +00:00
Update to crystal 0.22.0 (#50)
* `WeakRef#target` was renamed to `WeakRef#value`
This commit is contained in:
parent
912113d7fb
commit
5d5b901da1
2 changed files with 3 additions and 3 deletions
|
@ -54,7 +54,7 @@ module DB
|
|||
# TODO honor candidates while waiting for availables
|
||||
# this will allow us to remove `candidates.includes?(resource)`
|
||||
candidates.each do |ref|
|
||||
resource = ref.target
|
||||
resource = ref.value
|
||||
if resource && is_available?(resource)
|
||||
@available.delete resource
|
||||
resource.before_checkout
|
||||
|
@ -63,7 +63,7 @@ module DB
|
|||
end
|
||||
|
||||
resource = checkout
|
||||
{resource, candidates.any? { |ref| ref.target == resource }}
|
||||
{resource, candidates.any? { |ref| ref.value == resource }}
|
||||
end
|
||||
|
||||
def release(resource : T) : Nil
|
||||
|
|
|
@ -40,7 +40,7 @@ module DB
|
|||
private def clean_connections
|
||||
# remove disposed or closed connections
|
||||
@connections.each do |ref|
|
||||
conn = ref.target
|
||||
conn = ref.value
|
||||
if !conn || conn.closed?
|
||||
@connections.delete ref
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue