watermarkchurch / wcc-contentful

An alternative to Contentful's contentful.rb ruby client, contentful_model, and contentful_rails gems all in one.
MIT License
2 stars 1 forks source link

Use connection pool in PostgresStore #74

Closed chasestubblefield closed 6 years ago

chasestubblefield commented 6 years ago

This allows PostgresStore to be used in a threaded environment like with the puma web server.

An optional Hash with pool options can now passed when configuring the store:

config.content_delivery = :eager_sync, :postgres, ENV['POSTGRES_CONNECTION'], {size: 5, timeout: 5}

The default is the same as the connection_pool gem, {size: 5, timeout: 5}.

Also, the connection pool is available through PostgresStore#connection_pool to allow clearing active connections before forking, useful with puma or unicorn.

I think this is a cleaner approach than #69.

chasestubblefield commented 6 years ago

@gburgett Addressed your concerns about Query and added a test that uses threads, would appreciate your feedback. CI failures seem to be caused by latest Rubocop version.

watermarkchurch-bot commented 6 years ago
1 Warning
:warning: No issue referenced - please create an issue describing a single unit of work and reference it using “closes #[the issue number]”

Generated by :no_entry_sign: Danger

coveralls commented 6 years ago

Pull Request Test Coverage Report for Build 439


Files with Coverage Reduction New Missed Lines %
spec/support/fixtures_helper.rb 7 46.15%
<!-- Total: 7 -->
Totals Coverage Status
Change from base Build 429: -2.0%
Covered Lines: 526
Relevant Lines: 563

💛 - Coveralls