{"action":"created","issue":{"url":"https://api.github.com/repos/schmittjoh/JMSJobQueueBundle/issues/200","repository_url":"https://api.github.com/repos/schmittjoh/JMSJobQueueBundle","labels_url":"https://api.github.com/repos/schmittjoh/JMSJobQueueBundle/issues/200/labels{/name}","comments_url":"https://api.github.com/repos/schmittjoh/JMSJobQueueBundle/issues/200/comments","events_url":"https://api.github.com/repos/schmittjoh/JMSJobQueueBundle/issues/200/events","html_url":"https://github.com/schmittjoh/JMSJobQueueBundle/pull/200","id":296314147,"number":200,"title":"Add a «Progress» field for jobs","user":{"login":"chindit","id":2115451,"avatar_url":"https://avatars3.githubusercontent.com/u/2115451?v=4","gravatar_id":"","url":"https://api.github.com/users/chindit","html_url":"https://github.com/chindit","followers_url":"https://api.github.com/users/chindit/followers","following_url":"https://api.github.com/users/chindit/following{/other_user}","gists_url":"https://api.github.com/users/chindit/gists{/gist_id}","starred_url":"https://api.github.com/users/chindit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chindit/subscriptions","organizations_url":"https://api.github.com/users/chindit/orgs","repos_url":"https://api.github.com/users/chindit/repos","events_url":"https://api.github.com/users/chindit/events{/privacy}","received_events_url":"https://api.github.com/users/chindit/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-02-12T09:45:49Z","updated_at":"2018-03-27T16:53:40Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/schmittjoh/JMSJobQueueBundle/pulls/200","html_url":"https://github.com/schmittjoh/JMSJobQueueBundle/pull/200","diff_url":"https://github.com/schmittjoh/JMSJobQueueBundle/pull/200.diff","patch_url":"https://github.com/schmittjoh/JMSJobQueueBundle/pull/200.patch"},"body":"When running long jobs, it's cool to have an idea of the command's progress.\r\n\r\nSo, with a new `progress` field in Job table, we're able to set progression in the run command by using `jms-job-id` argument.\r\n\r\nFor example, a command could look like this:\r\n```\r\nprotected function execute(InputInterface $input, OutputInterface $output)\r\n{\r\n       // ……\r\n       // Do stuff\r\n       // ……\r\n        $argument = $input->getOption('jms-job-id');\r\n        $job = $this->entityManager->getRepository(Job::class)->find($argument);\r\n        $job->setProgress(0.3);\r\n        $this->entityManager->flush($job);\r\n        // ……\r\n        // Do other stuff\r\n        // ……\r\n        $job->setProgress(0.6);\r\n        $this->entityManager->flush($job);\r\n\r\n        // Etc\r\n        // ……\r\n}\r\n```\r\n\r\nOf course, when a job is finished, its progress is automatically set to 1.\r\nIf job fails or is terminated without success, its last progress is kept."},"comment":{"url":"https://api.github.com/repos/schmittjoh/JMSJobQueueBundle/issues/comments/376596995","html_url":"https://github.com/schmittjoh/JMSJobQueueBundle/pull/200#issuecomment-376596995","issue_url":"https://api.github.com/repos/schmittjoh/JMSJobQueueBundle/issues/200","id":376596995,"user":{"login":"olix21","id":3217330,"avatar_url":"https://avatars2.githubusercontent.com/u/3217330?v=4","gravatar_id":"","url":"https://api.github.com/users/olix21","html_url":"https://github.com/olix21","followers_url":"https://api.github.com/users/olix21/followers","following_url":"https://api.github.com/users/olix21/following{/other_user}","gists_url":"https://api.github.com/users/olix21/gists{/gist_id}","starred_url":"https://api.github.com/users/olix21/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olix21/subscriptions","organizations_url":"https://api.github.com/users/olix21/orgs","repos_url":"https://api.github.com/users/olix21/repos","events_url":"https://api.github.com/users/olix21/events{/privacy}","received_events_url":"https://api.github.com/users/olix21/received_events","type":"User","site_admin":false},"created_at":"2018-03-27T16:53:40Z","updated_at":"2018-03-27T16:53:40Z","author_association":"NONE","body":"Yeah but extending your entity is very hard because it's not a doctrine super mapped entity, and there is no interface we can extend or working with. The only way for me is to make a fork but I dislike this idea too"}}
{"actor":{"display_login":"olix21"}}