Giter Club home page Giter Club logo

whatweate's Introduction

Build status Test Coverage Code Climate

WhatWeAte

WhatWeAte at 31 May 2015

Getting started

  • Ruby 2.2.2
  • Rails 4.2.1
  • PostgreSQL
  • Start server with foreman start --port 3000

Dependencies

  • Redis for Sidekiq
  • Photo uploading and processing is handled by CarrierWave, you'll need to install imagemagick for versions (e.g. thumbnail). This should be as easy as brew install imagemagick.

Staging and Production environments

Hosted on Heroku, install the CLI. CircleCI automatically deploys develop to QA, master to Staging on green builds.

Deployment

heroku git:remote -a whatweate-qa -r qa
heroku git:remote -a whatweate-staging -r staging
heroku git:remote -a whatweate-production -r production

QA and Staging are configured to be continuously deployed from develop and master respectively. Production deploys are manual using the following.

git push production <branch>:master && heroku run rake db:migrate -r production

whatweate's People

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

whatweate's Issues

PG::ConnectionBad: PQconsumeInput() SSL connection has been closed unexpectedly

 $ heroku ps -r qa
=== worker (Free): `bundle exec rake jobs:work`
worker.1: crashed 2015/06/16 11:31:06 (~ 7m ago)
2015-06-16T10:30:19.327032+00:00 app[worker.1]: : UPDATE "delayed_jobs" SET locked_at = '2015-06-16 10:30:19.325347', locked_by = 'host:a2da648b-2768-4979-af05-b0b1ae7e8a24 pid:3' WHERE id IN (SELECT  "delayed_jobs"."id" FROM "delayed_jobs" WHERE ((run_at <= '2015-06-16 10:30:19.324813' AND (locked_at IS NULL OR locked_at < '2015-06-16 06:30:19.324849') OR locked_by = 'host:a2da648b-2768-4979-af05-b0b1ae7e8a24 pid:3') AND failed_at IS NULL)  ORDER BY priority ASC, run_at ASC LIMIT 1 FOR UPDATE) RETURNING *
2015-06-16T10:30:19.326903+00:00 app[worker.1]: [Worker(host:a2da648b-2768-4979-af05-b0b1ae7e8a24 pid:3)] Error while reserving job: PG::ConnectionBad: PQconsumeInput() SSL connection has been closed unexpectedly

Delayed Jobs tries to update the database which sometimes loses connection as we are using the hobby tier, which has unannounced maintenance:

One of the limitations of the hobby tier databases is unannounced maintenance. We will occasionally need to close some connections to hobby tier databases, and when we do that, the app will often see an error like this one.

Most apps that maintain a connection pool (like ActiveRecord in Rails) can just open a new connection to the database. However, in some cases an app won't be able reconnect. If that happens, you can heroku restart that dyno to get a new process on a new runtime.

Further reading:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.