Skip to content

Commit

Permalink
Safely close the connection to the sqlite3 database on Ctrl^C.
Browse files Browse the repository at this point in the history
  • Loading branch information
postmodern committed May 3, 2024
1 parent 5ada7f7 commit 4e143f5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions config/database.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@
end

Ronin::DB.connect(database, pool: pool_size)

at_exit do
ActiveRecord::Base.connection_pool.disconnect!
end

0 comments on commit 4e143f5

Please sign in to comment.