You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12 lines
475 B

module CartoDB
module SequelConnectionHelper
def close_sequel_connection(connection)
connection.disconnect
# Sequel keeps a list of all databases it has connected to that is never deleted
# We must manually delete the connection or it is never garbage collected, leaking memory
# See https://github.com/jeremyevans/sequel/blob/3.42.0/lib/sequel/database.rb#L10
Sequel.synchronize { Sequel::DATABASES.delete(connection) }
end
end
end