{"action":"created","comment":{"url":"https://api.github.com/repos/Wikia/app/pulls/comments/42963819","id":42963819,"diff_hunk":"@@ -61,92 +42,33 @@ public function publish( $routingKey, $body ) {\n \t\t);\n \t}\n \n-\t/**\n-\t * Will ack on all true and null results, on false no action, on error no_ack\n-\t * @param AMQPMessage $msg\n-\t */\n-\tprotected function route( AMQPMessage $msg ) {\n-\t\ttry {\n-\t\t\t$result = call_user_func( self::$binding[ 0 ], json_decode( $msg->body ) );\n-\t\t} catch ( Exception $e ) {\n-\t\t\t$msg->delivery_info[ 'channel' ]->basic_reject( $msg->delivery_info[ 'delivery_tag' ], self::NO_REQUEUE );\n-\t\t}\n-\t\tif ( !isset( $result ) || $result ) {\n-\t\t\t$msg->delivery_info[ 'channel' ]->basic_ack( $msg->delivery_info[ 'delivery_tag' ] );\n-\t\t}\n-\t}\n-\n \t/** @return \\PhpAmqpLib\\Channel\\AMQPChannel */\n-\tprotected function setUpPublishChannel() {\n-\t\tif ( !isset( $this->publishChannel ) || !$this->publishChannel->is_open ) {\n-\t\t\t$pubConn = $this->getPublishConnection();\n-\t\t\t$this->publishChannel = $pubConn->channel();\n+\tprotected function getChannel() {\n+\t\tif ( !isset( $this->channel ) || !$this->channel->is_open ) {\n+\t\t\t$pubConn = $this->getConnection();\n+\t\t\t$this->channel = $pubConn->channel();\n \t\t}\n-\t\treturn $this->publishChannel;\n-\t}\n \n-\t/** @return \\PhpAmqpLib\\Channel\\AMQPChannel */\n-\tprotected function setUpMainChannel() {\n-\t\t// check if binding was set\n-\t\tif ( is_array( self::$binding ) && is_callable( self::$binding[ 0 ] ) ) {\n-\t\t\tif ( !isset( $this->mainChannel ) ) {\n-\t\t\t\t$mainConn = $this->getMainConnection();\n-\t\t\t\t$this->mainChannel = $mainConn->channel();\n-\t\t\t\t$qName = $this->getQueueName();\n-\t\t\t\t$this->mainChannel->queue_declare( $qName, false, true, false, true, false, [\n-\t\t\t\t\t'x-dead-letter-exchange' => [ 'S', $this->deadExchange ]\n-\t\t\t\t] );\n-\t\t\t\t$this->mainChannel->queue_bind( $qName, $this->exchange, key( self::$binding ) );\n-\t\t\t\t$this->mainChannel->basic_qos( self::$prefetch );\n-\t\t\t\t$this->mainChannel->basic_consume( $qName, '', false, false, false, false, [ $this, 'route' ] );\n-\t\t\t}\n-\t\t\treturn $this->mainChannel;\n-\t\t}\n-\t\tthrow new WikiaException( 'Binding must be set in child class' );\n+\t\treturn $this->channel;\n \t}\n \n-\tprotected function closeMainChannel() {\n-\t\tif ( isset( $this->mainChannel ) ) {\n-\t\t\t$this->mainChannel->close();\n-\t\t\tunset( $this->mainChannel );\n-\t\t}\n-\t}\n-\n-\tprotected function getQueueName() {\n-\t\treturn implode( '.', [ get_class( $this ), key( self::$binding ), self::QUEUE_NAME_POSTFIX ] );\n-\t}\n-\n-\tprotected function createNewConnection() {\n+\tprotected function createConnection() {\n \t\treturn new AMQPConnection( $this->host, $this->port, $this->user, $this->pass, $this->vhost );","path":"extensions/wikia/IndexingPipeline/PipelineConnectionBase.class.php","position":118,"original_position":118,"commit_id":"6983d00c24cc57a82e0d922c03d62614714b9067","original_commit_id":"35344ef8a80b8d60a01bae2a0cb387a4a6699feb","user":{"login":"SebastianMarzjan","id":2051084,"avatar_url":"https://avatars.githubusercontent.com/u/2051084?v=3","gravatar_id":"","url":"https://api.github.com/users/SebastianMarzjan","html_url":"https://github.com/SebastianMarzjan","followers_url":"https://api.github.com/users/SebastianMarzjan/followers","following_url":"https://api.github.com/users/SebastianMarzjan/following{/other_user}","gists_url":"https://api.github.com/users/SebastianMarzjan/gists{/gist_id}","starred_url":"https://api.github.com/users/SebastianMarzjan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SebastianMarzjan/subscriptions","organizations_url":"https://api.github.com/users/SebastianMarzjan/orgs","repos_url":"https://api.github.com/users/SebastianMarzjan/repos","events_url":"https://api.github.com/users/SebastianMarzjan/events{/privacy}","received_events_url":"https://api.github.com/users/SebastianMarzjan/received_events","type":"User","site_admin":false},"body":":+1: ","created_at":"2015-10-26T06:54:02Z","updated_at":"2015-10-26T06:54:02Z","html_url":"https://github.com/Wikia/app/pull/8862#discussion_r42963819","pull_request_url":"https://api.github.com/repos/Wikia/app/pulls/8862","_links":{"self":{"href":"https://api.github.com/repos/Wikia/app/pulls/comments/42963819"},"html":{"href":"https://github.com/Wikia/app/pull/8862#discussion_r42963819"},"pull_request":{"href":"https://api.github.com/repos/Wikia/app/pulls/8862"}}},"pull_request":{"url":"https://api.github.com/repos/Wikia/app/pulls/8862","id":48470121,"html_url":"https://github.com/Wikia/app/pull/8862","diff_url":"https://github.com/Wikia/app/pull/8862.diff","patch_url":"https://github.com/Wikia/app/pull/8862.patch","issue_url":"https://api.github.com/repos/Wikia/app/issues/8862","number":8862,"state":"open","locked":false,"title":"DAT-3398 Send event to rabbit on article changes","user":{"login":"dianafa","id":3716441,"avatar_url":"https://avatars.githubusercontent.com/u/3716441?v=3","gravatar_id":"","url":"https://api.github.com/users/dianafa","html_url":"https://github.com/dianafa","followers_url":"https://api.github.com/users/dianafa/followers","following_url":"https://api.github.com/users/dianafa/following{/other_user}","gists_url":"https://api.github.com/users/dianafa/gists{/gist_id}","starred_url":"https://api.github.com/users/dianafa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dianafa/subscriptions","organizations_url":"https://api.github.com/users/dianafa/orgs","repos_url":"https://api.github.com/users/dianafa/repos","events_url":"https://api.github.com/users/dianafa/events{/privacy}","received_events_url":"https://api.github.com/users/dianafa/received_events","type":"User","site_admin":false},"body":"https://wikia-inc.atlassian.net/browse/DAT-3398","created_at":"2015-10-22T15:10:20Z","updated_at":"2015-10-26T06:54:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2a84e4df65ac88e3c71b67c6dec7ef1137d0e50b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Wikia/app/pulls/8862/commits","review_comments_url":"https://api.github.com/repos/Wikia/app/pulls/8862/comments","review_comment_url":"https://api.github.com/repos/Wikia/app/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Wikia/app/issues/8862/comments","statuses_url":"https://api.github.com/repos/Wikia/app/statuses/6983d00c24cc57a82e0d922c03d62614714b9067","head":{"label":"Wikia:DAT-3398","ref":"DAT-3398","sha":"6983d00c24cc57a82e0d922c03d62614714b9067","user":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"repo":{"id":5532313,"name":"app","full_name":"Wikia/app","owner":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Wikia/app","description":"Wikia Application Code","fork":false,"url":"https://api.github.com/repos/Wikia/app","forks_url":"https://api.github.com/repos/Wikia/app/forks","keys_url":"https://api.github.com/repos/Wikia/app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Wikia/app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Wikia/app/teams","hooks_url":"https://api.github.com/repos/Wikia/app/hooks","issue_events_url":"https://api.github.com/repos/Wikia/app/issues/events{/number}","events_url":"https://api.github.com/repos/Wikia/app/events","assignees_url":"https://api.github.com/repos/Wikia/app/assignees{/user}","branches_url":"https://api.github.com/repos/Wikia/app/branches{/branch}","tags_url":"https://api.github.com/repos/Wikia/app/tags","blobs_url":"https://api.github.com/repos/Wikia/app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Wikia/app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Wikia/app/git/refs{/sha}","trees_url":"https://api.github.com/repos/Wikia/app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Wikia/app/statuses/{sha}","languages_url":"https://api.github.com/repos/Wikia/app/languages","stargazers_url":"https://api.github.com/repos/Wikia/app/stargazers","contributors_url":"https://api.github.com/repos/Wikia/app/contributors","subscribers_url":"https://api.github.com/repos/Wikia/app/subscribers","subscription_url":"https://api.github.com/repos/Wikia/app/subscription","commits_url":"https://api.github.com/repos/Wikia/app/commits{/sha}","git_commits_url":"https://api.github.com/repos/Wikia/app/git/commits{/sha}","comments_url":"https://api.github.com/repos/Wikia/app/comments{/number}","issue_comment_url":"https://api.github.com/repos/Wikia/app/issues/comments{/number}","contents_url":"https://api.github.com/repos/Wikia/app/contents/{+path}","compare_url":"https://api.github.com/repos/Wikia/app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Wikia/app/merges","archive_url":"https://api.github.com/repos/Wikia/app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Wikia/app/downloads","issues_url":"https://api.github.com/repos/Wikia/app/issues{/number}","pulls_url":"https://api.github.com/repos/Wikia/app/pulls{/number}","milestones_url":"https://api.github.com/repos/Wikia/app/milestones{/number}","notifications_url":"https://api.github.com/repos/Wikia/app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Wikia/app/labels{/name}","releases_url":"https://api.github.com/repos/Wikia/app/releases{/id}","created_at":"2012-08-23T20:55:58Z","updated_at":"2015-10-24T22:07:11Z","pushed_at":"2015-10-24T18:07:09Z","git_url":"git://github.com/Wikia/app.git","ssh_url":"git@github.com:Wikia/app.git","clone_url":"https://github.com/Wikia/app.git","svn_url":"https://github.com/Wikia/app","homepage":"http://dev.wikia.com","size":1684422,"stargazers_count":91,"watchers_count":91,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":70,"mirror_url":null,"open_issues_count":66,"forks":70,"open_issues":66,"watchers":91,"default_branch":"dev"}},"base":{"label":"Wikia:dev","ref":"dev","sha":"5add8b38ffd6b5ce19532e0dd60add331c46bc8f","user":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"repo":{"id":5532313,"name":"app","full_name":"Wikia/app","owner":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Wikia/app","description":"Wikia Application Code","fork":false,"url":"https://api.github.com/repos/Wikia/app","forks_url":"https://api.github.com/repos/Wikia/app/forks","keys_url":"https://api.github.com/repos/Wikia/app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Wikia/app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Wikia/app/teams","hooks_url":"https://api.github.com/repos/Wikia/app/hooks","issue_events_url":"https://api.github.com/repos/Wikia/app/issues/events{/number}","events_url":"https://api.github.com/repos/Wikia/app/events","assignees_url":"https://api.github.com/repos/Wikia/app/assignees{/user}","branches_url":"https://api.github.com/repos/Wikia/app/branches{/branch}","tags_url":"https://api.github.com/repos/Wikia/app/tags","blobs_url":"https://api.github.com/repos/Wikia/app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Wikia/app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Wikia/app/git/refs{/sha}","trees_url":"https://api.github.com/repos/Wikia/app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Wikia/app/statuses/{sha}","languages_url":"https://api.github.com/repos/Wikia/app/languages","stargazers_url":"https://api.github.com/repos/Wikia/app/stargazers","contributors_url":"https://api.github.com/repos/Wikia/app/contributors","subscribers_url":"https://api.github.com/repos/Wikia/app/subscribers","subscription_url":"https://api.github.com/repos/Wikia/app/subscription","commits_url":"https://api.github.com/repos/Wikia/app/commits{/sha}","git_commits_url":"https://api.github.com/repos/Wikia/app/git/commits{/sha}","comments_url":"https://api.github.com/repos/Wikia/app/comments{/number}","issue_comment_url":"https://api.github.com/repos/Wikia/app/issues/comments{/number}","contents_url":"https://api.github.com/repos/Wikia/app/contents/{+path}","compare_url":"https://api.github.com/repos/Wikia/app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Wikia/app/merges","archive_url":"https://api.github.com/repos/Wikia/app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Wikia/app/downloads","issues_url":"https://api.github.com/repos/Wikia/app/issues{/number}","pulls_url":"https://api.github.com/repos/Wikia/app/pulls{/number}","milestones_url":"https://api.github.com/repos/Wikia/app/milestones{/number}","notifications_url":"https://api.github.com/repos/Wikia/app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Wikia/app/labels{/name}","releases_url":"https://api.github.com/repos/Wikia/app/releases{/id}","created_at":"2012-08-23T20:55:58Z","updated_at":"2015-10-24T22:07:11Z","pushed_at":"2015-10-24T18:07:09Z","git_url":"git://github.com/Wikia/app.git","ssh_url":"git@github.com:Wikia/app.git","clone_url":"https://github.com/Wikia/app.git","svn_url":"https://github.com/Wikia/app","homepage":"http://dev.wikia.com","size":1684422,"stargazers_count":91,"watchers_count":91,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":70,"mirror_url":null,"open_issues_count":66,"forks":70,"open_issues":66,"watchers":91,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/Wikia/app/pulls/8862"},"html":{"href":"https://github.com/Wikia/app/pull/8862"},"issue":{"href":"https://api.github.com/repos/Wikia/app/issues/8862"},"comments":{"href":"https://api.github.com/repos/Wikia/app/issues/8862/comments"},"review_comments":{"href":"https://api.github.com/repos/Wikia/app/pulls/8862/comments"},"review_comment":{"href":"https://api.github.com/repos/Wikia/app/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Wikia/app/pulls/8862/commits"},"statuses":{"href":"https://api.github.com/repos/Wikia/app/statuses/6983d00c24cc57a82e0d922c03d62614714b9067"}}}}