{"action":"created","issue":{"url":"https://api.github.com/repos/chanks/que/issues/116","labels_url":"https://api.github.com/repos/chanks/que/issues/116/labels{/name}","comments_url":"https://api.github.com/repos/chanks/que/issues/116/comments","events_url":"https://api.github.com/repos/chanks/que/issues/116/events","html_url":"https://github.com/chanks/que/pull/116","id":95785333,"number":116,"title":"Clear active ActiveRecord connections between jobs.","user":{"login":"thomasfedb","id":193831,"avatar_url":"https://avatars.githubusercontent.com/u/193831?v=3","gravatar_id":"","url":"https://api.github.com/users/thomasfedb","html_url":"https://github.com/thomasfedb","followers_url":"https://api.github.com/users/thomasfedb/followers","following_url":"https://api.github.com/users/thomasfedb/following{/other_user}","gists_url":"https://api.github.com/users/thomasfedb/gists{/gist_id}","starred_url":"https://api.github.com/users/thomasfedb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thomasfedb/subscriptions","organizations_url":"https://api.github.com/users/thomasfedb/orgs","repos_url":"https://api.github.com/users/thomasfedb/repos","events_url":"https://api.github.com/users/thomasfedb/events{/privacy}","received_events_url":"https://api.github.com/users/thomasfedb/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":20,"created_at":"2015-07-18T03:55:56Z","updated_at":"2015-09-25T20:07:49Z","closed_at":"2015-07-25T12:37:10Z","pull_request":{"url":"https://api.github.com/repos/chanks/que/pulls/116","html_url":"https://github.com/chanks/que/pull/116","diff_url":"https://github.com/chanks/que/pull/116.diff","patch_url":"https://github.com/chanks/que/pull/116.patch"},"body":"After having significant issues with long running database connections that only ever occurred on my worker processes, and not on my web processes, I investigated and found that Rails clears out active connections between each web request.\r\n\r\nThis PR implements the same connection clearing for Que. I'm sure the implementation is not ideal, and I'm happy to revise it with some advice. This has been running successfully in a production environment for a number of months, resolving all issues with long running database connections."},"comment":{"url":"https://api.github.com/repos/chanks/que/issues/comments/143339663","html_url":"https://github.com/chanks/que/pull/116#issuecomment-143339663","issue_url":"https://api.github.com/repos/chanks/que/issues/116","id":143339663,"user":{"login":"chanks","id":300058,"avatar_url":"https://avatars.githubusercontent.com/u/300058?v=3","gravatar_id":"","url":"https://api.github.com/users/chanks","html_url":"https://github.com/chanks","followers_url":"https://api.github.com/users/chanks/followers","following_url":"https://api.github.com/users/chanks/following{/other_user}","gists_url":"https://api.github.com/users/chanks/gists{/gist_id}","starred_url":"https://api.github.com/users/chanks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chanks/subscriptions","organizations_url":"https://api.github.com/users/chanks/orgs","repos_url":"https://api.github.com/users/chanks/repos","events_url":"https://api.github.com/users/chanks/events{/privacy}","received_events_url":"https://api.github.com/users/chanks/received_events","type":"User","site_admin":false},"created_at":"2015-09-25T20:07:49Z","updated_at":"2015-09-25T20:07:49Z","body":"Que::Job.work isn't usually called by the application, it's called by a worker, which is generally operating in a very simple loop without a lot of state going on, especially not in the DB (it's not intended to be called inside a transaction, for example). If you really wanted to call it from within your app, I suppose you could, but you'd need to be careful."}}