mirror of
https://gitea.invidious.io/iv-org/shard-crystal-db.git
synced 2024-08-15 00:53:32 +00:00
Track connections only if statements_cache is enabled
This commit is contained in:
parent
ad41c258c8
commit
89e32c6e0a
1 changed files with 3 additions and 1 deletions
|
@ -53,7 +53,7 @@ module DB
|
|||
conn.release
|
||||
raise ex
|
||||
end
|
||||
unless existing
|
||||
if !existing && @db.prepared_statements_cache?
|
||||
@mutex.synchronize do
|
||||
@connections << WeakRef.new(conn)
|
||||
end
|
||||
|
@ -62,6 +62,8 @@ module DB
|
|||
end
|
||||
|
||||
private def clean_connections
|
||||
return unless @db.prepared_statements_cache?
|
||||
|
||||
@mutex.synchronize do
|
||||
# remove disposed or closed connections
|
||||
@connections.each do |ref|
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue