{"action":"created","issue":{"url":"https://api.github.com/repos/polygon-city/polygon-city-cli/issues/11","labels_url":"https://api.github.com/repos/polygon-city/polygon-city-cli/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/polygon-city/polygon-city-cli/issues/11/comments","events_url":"https://api.github.com/repos/polygon-city/polygon-city-cli/issues/11/events","html_url":"https://github.com/polygon-city/polygon-city-cli/issues/11","id":127208617,"number":11,"title":"Give queues / workers time to shut down gracefully before exiting","user":{"login":"robhawkes","id":22612,"avatar_url":"https://avatars.githubusercontent.com/u/22612?v=3","gravatar_id":"","url":"https://api.github.com/users/robhawkes","html_url":"https://github.com/robhawkes","followers_url":"https://api.github.com/users/robhawkes/followers","following_url":"https://api.github.com/users/robhawkes/following{/other_user}","gists_url":"https://api.github.com/users/robhawkes/gists{/gist_id}","starred_url":"https://api.github.com/users/robhawkes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robhawkes/subscriptions","organizations_url":"https://api.github.com/users/robhawkes/orgs","repos_url":"https://api.github.com/users/robhawkes/repos","events_url":"https://api.github.com/users/robhawkes/events{/privacy}","received_events_url":"https://api.github.com/users/robhawkes/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/polygon-city/polygon-city-cli/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-18T11:36:07Z","updated_at":"2016-01-27T08:42:49Z","closed_at":"2016-01-27T08:42:49Z","body":"When forcing an exit (ctrl+c) or when the app exits automatically it currently does this naively and doesn't wait for things to finish before closing everything down (aside from a fixed delay). This causes remnants to remain in the system, such as not probably clearing up and removing the Redis queues. I believe this is because the workers are being shut down before the [`onComplete` handlers](https://github.com/polygon-city/polygon-city-cli/blob/master/queues/convertObj.js#L15) are picked up to clean Redis.\r\n\r\nIt would be good if the queue workers were allowed to shut down gracefully before exiting, or at least give them a chance to and then enforce an exit if they don't do so within some time period."},"comment":{"url":"https://api.github.com/repos/polygon-city/polygon-city-cli/issues/comments/175484199","html_url":"https://github.com/polygon-city/polygon-city-cli/issues/11#issuecomment-175484199","issue_url":"https://api.github.com/repos/polygon-city/polygon-city-cli/issues/11","id":175484199,"user":{"login":"robhawkes","id":22612,"avatar_url":"https://avatars.githubusercontent.com/u/22612?v=3","gravatar_id":"","url":"https://api.github.com/users/robhawkes","html_url":"https://github.com/robhawkes","followers_url":"https://api.github.com/users/robhawkes/followers","following_url":"https://api.github.com/users/robhawkes/following{/other_user}","gists_url":"https://api.github.com/users/robhawkes/gists{/gist_id}","starred_url":"https://api.github.com/users/robhawkes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robhawkes/subscriptions","organizations_url":"https://api.github.com/users/robhawkes/orgs","repos_url":"https://api.github.com/users/robhawkes/repos","events_url":"https://api.github.com/users/robhawkes/events{/privacy}","received_events_url":"https://api.github.com/users/robhawkes/received_events","type":"User","site_admin":false},"created_at":"2016-01-27T08:42:49Z","updated_at":"2016-01-27T08:42:49Z","body":"A lot of improvements have recently landed around handling how the jobs exit. I'm going to close this and we can open issues for any specific problems."}}