Skip to content
This repository has been archived by the owner on Aug 13, 2019. It is now read-only.

Fix Mongo connection pool size to match thread pool size #24

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lib/gaps/db.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ class UniqueKeyViolation < DBError; end

def self.init
MongoMapper.database = configatron.db.database
MongoMapper.connection = Mongo::MongoClient.from_uri(configatron.db.mongodb_url, pool_size: 5)
MongoMapper.connection = Mongo::MongoClient.from_uri(
configatron.db.mongodb_url,
pool_size: [configatron.cache.pool_size, 5].max
)

Cache.build_index
Group.build_index
Expand Down