Sha256: c06a6afacbe0d6b15c0f17eb55ed0a55e921d9898c6083bc7f3b6cd5f15e6bb8
Contents?: true
Size: 675 Bytes
Versions: 9
Compression:
Stored size: 675 Bytes
Contents
# frozen_string_literal: true module Anycable module Rails module ActiveRecord # Release ActiveRecord connection after every call (if any) module ReleaseConnection def connect(*) wrap_release_connection { super } end def disconnect(*) wrap_release_connection { super } end def command(*) wrap_release_connection { super } end def wrap_release_connection res = yield ::ActiveRecord::Base.connection_pool.release_connection if ::ActiveRecord::Base.connection_pool.active_connection? res end end end end end
Version data entries
9 entries across 9 versions & 1 rubygems