{"action":"created","issue":{"url":"https://api.github.com/repos/joowani/kq/issues/5","repository_url":"https://api.github.com/repos/joowani/kq","labels_url":"https://api.github.com/repos/joowani/kq/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/joowani/kq/issues/5/comments","events_url":"https://api.github.com/repos/joowani/kq/issues/5/events","html_url":"https://github.com/joowani/kq/pull/5","id":195162157,"number":5,"title":"Dont commit on shutdown if task hasnt finished","user":{"login":"shashankmehra","id":1669512,"avatar_url":"https://avatars.githubusercontent.com/u/1669512?v=3","gravatar_id":"","url":"https://api.github.com/users/shashankmehra","html_url":"https://github.com/shashankmehra","followers_url":"https://api.github.com/users/shashankmehra/followers","following_url":"https://api.github.com/users/shashankmehra/following{/other_user}","gists_url":"https://api.github.com/users/shashankmehra/gists{/gist_id}","starred_url":"https://api.github.com/users/shashankmehra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shashankmehra/subscriptions","organizations_url":"https://api.github.com/users/shashankmehra/orgs","repos_url":"https://api.github.com/users/shashankmehra/repos","events_url":"https://api.github.com/users/shashankmehra/events{/privacy}","received_events_url":"https://api.github.com/users/shashankmehra/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-12-13T05:03:46Z","updated_at":"2016-12-13T06:50:11Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/joowani/kq/pulls/5","html_url":"https://github.com/joowani/kq/pull/5","diff_url":"https://github.com/joowani/kq/pull/5.diff","patch_url":"https://github.com/joowani/kq/pull/5.patch"},"body":"The issue I faced was that on shutdown of the worker if the worker was processing a task, it would abandon the task in the middle of its processing, and commit the record. This would result in half processed tasks which are never picked up again. Since this is a job queue, I have to make my tasks idempotent regardless, it makes sense to have another worker pick up the task instead of the task getting dropped. I have mitigated this issue for myself using these changes. Not sure if this is the best way to go about it. Please let me know your thoughts. It might also be a good idea to implement a graceful shutdown."},"comment":{"url":"https://api.github.com/repos/joowani/kq/issues/comments/266661010","html_url":"https://github.com/joowani/kq/pull/5#issuecomment-266661010","issue_url":"https://api.github.com/repos/joowani/kq/issues/5","id":266661010,"user":{"login":"shashankmehra","id":1669512,"avatar_url":"https://avatars.githubusercontent.com/u/1669512?v=3","gravatar_id":"","url":"https://api.github.com/users/shashankmehra","html_url":"https://github.com/shashankmehra","followers_url":"https://api.github.com/users/shashankmehra/followers","following_url":"https://api.github.com/users/shashankmehra/following{/other_user}","gists_url":"https://api.github.com/users/shashankmehra/gists{/gist_id}","starred_url":"https://api.github.com/users/shashankmehra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shashankmehra/subscriptions","organizations_url":"https://api.github.com/users/shashankmehra/orgs","repos_url":"https://api.github.com/users/shashankmehra/repos","events_url":"https://api.github.com/users/shashankmehra/events{/privacy}","received_events_url":"https://api.github.com/users/shashankmehra/received_events","type":"User","site_admin":false},"created_at":"2016-12-13T06:50:11Z","updated_at":"2016-12-13T06:50:11Z","body":"Thanks. Removing the commit from __del__ makes things easier.\r\nenqueue_with_key also makes things easier since I am not forced to create a Job object on my own. I will be able to test it a little later and let you know."}}
{"actor":{"display_login":"shashankmehra"}}