{"action":"created","comment":{"url":"https://api.github.com/repos/kaltura/server/pulls/comments/45715441","id":45715441,"diff_hunk":"@@ -246,26 +246,40 @@ function registerMediaServerAction($entryId, $hostname, $mediaServerIndex, $appl\n \t\t}\n \n \t\t$dbEntry->setRedirectEntryId(null);\n-\t\t\n \t\tif($dbEntry->save())\n \t\t{\n \t\t\tif($mediaServerIndex == MediaServerIndex::PRIMARY && $dbEntry->getRecordStatus())\n \t\t\t{\n+\t\t\t\tKalturaLog::info(\"Checking if recorded entry needs to be created for entry $entryId\");\n \t\t\t\t$createRecordedEntry = false;\n \t\t\t\tif(!$dbEntry->getRecordedEntryId())\n \t\t\t\t{\n \t\t\t\t\t$createRecordedEntry = true;\n+\t\t\t\t\tKalturaLog::info(\"Creating new recoreded entry for $entryId \");\n \t\t\t\t}\n-\t\t\t\telseif($dbEntry->getRecordStatus() == RecordStatus::PER_SESSION && ($dbEntry->getLastBroadcastEndTime() + kConf::get('live_session_reconnect_timeout', 'local', 180) < time()))\n-\t\t\t\t{\n-\t\t\t\t\t$createRecordedEntry = true;\n+\t\t\t\telse {\n+\t\t\t\t\t$dbRecordedEntry = entryPeer::retrieveByPK($dbEntry->getRecordedEntryId());\n+\t\t\t\t\tif (!$dbRecordedEntry) {\n+\t\t\t\t\t\tthrow new KalturaAPIException(KalturaErrors::ENTRY_ID_NOT_FOUND, $dbRecordedEntry);\n+\t\t\t\t\t}\n+\t\t\t\t\t$recordedEntryCreationTime = strtotime($dbRecordedEntry->getCreatedAt());","path":"api_v3/lib/KalturaLiveEntryService.php","position":217,"original_position":217,"commit_id":"766b3b7394f27df3f26411b24c7d65f4aa2031aa","original_commit_id":"766b3b7394f27df3f26411b24c7d65f4aa2031aa","user":{"login":"tan-tan-kanarek","id":1793469,"avatar_url":"https://avatars.githubusercontent.com/u/1793469?v=3","gravatar_id":"","url":"https://api.github.com/users/tan-tan-kanarek","html_url":"https://github.com/tan-tan-kanarek","followers_url":"https://api.github.com/users/tan-tan-kanarek/followers","following_url":"https://api.github.com/users/tan-tan-kanarek/following{/other_user}","gists_url":"https://api.github.com/users/tan-tan-kanarek/gists{/gist_id}","starred_url":"https://api.github.com/users/tan-tan-kanarek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tan-tan-kanarek/subscriptions","organizations_url":"https://api.github.com/users/tan-tan-kanarek/orgs","repos_url":"https://api.github.com/users/tan-tan-kanarek/repos","events_url":"https://api.github.com/users/tan-tan-kanarek/events{/privacy}","received_events_url":"https://api.github.com/users/tan-tan-kanarek/received_events","type":"User","site_admin":false},"body":"Instead, use:\r\n$recordedEntryCreationTime = $dbRecordedEntry->getCreatedAt(null);","created_at":"2015-11-24T10:00:09Z","updated_at":"2015-11-24T10:00:09Z","html_url":"https://github.com/kaltura/server/pull/3537#discussion_r45715441","pull_request_url":"https://api.github.com/repos/kaltura/server/pulls/3537","_links":{"self":{"href":"https://api.github.com/repos/kaltura/server/pulls/comments/45715441"},"html":{"href":"https://github.com/kaltura/server/pull/3537#discussion_r45715441"},"pull_request":{"href":"https://api.github.com/repos/kaltura/server/pulls/3537"}}},"pull_request":{"url":"https://api.github.com/repos/kaltura/server/pulls/3537","id":51628732,"html_url":"https://github.com/kaltura/server/pull/3537","diff_url":"https://github.com/kaltura/server/pull/3537.diff","patch_url":"https://github.com/kaltura/server/pull/3537.patch","issue_url":"https://api.github.com/repos/kaltura/server/issues/3537","number":3537,"state":"open","locked":false,"title":"Ensuring that a per session recorded entry is created exactly once pe…","user":{"login":"eladBenedict","id":11731485,"avatar_url":"https://avatars.githubusercontent.com/u/11731485?v=3","gravatar_id":"","url":"https://api.github.com/users/eladBenedict","html_url":"https://github.com/eladBenedict","followers_url":"https://api.github.com/users/eladBenedict/followers","following_url":"https://api.github.com/users/eladBenedict/following{/other_user}","gists_url":"https://api.github.com/users/eladBenedict/gists{/gist_id}","starred_url":"https://api.github.com/users/eladBenedict/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eladBenedict/subscriptions","organizations_url":"https://api.github.com/users/eladBenedict/orgs","repos_url":"https://api.github.com/users/eladBenedict/repos","events_url":"https://api.github.com/users/eladBenedict/events{/privacy}","received_events_url":"https://api.github.com/users/eladBenedict/received_events","type":"User","site_admin":false},"body":"…r session","created_at":"2015-11-24T08:18:57Z","updated_at":"2015-11-24T10:00:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"eebd0d8f5b53d250e0ae3f0f204e5f9038bac7e8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/kaltura/server/pulls/3537/commits","review_comments_url":"https://api.github.com/repos/kaltura/server/pulls/3537/comments","review_comment_url":"https://api.github.com/repos/kaltura/server/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kaltura/server/issues/3537/comments","statuses_url":"https://api.github.com/repos/kaltura/server/statuses/766b3b7394f27df3f26411b24c7d65f4aa2031aa","head":{"label":"kaltura:Kajam-11.3.0-SUP-4598","ref":"Kajam-11.3.0-SUP-4598","sha":"766b3b7394f27df3f26411b24c7d65f4aa2031aa","user":{"login":"kaltura","id":319096,"avatar_url":"https://avatars.githubusercontent.com/u/319096?v=3","gravatar_id":"","url":"https://api.github.com/users/kaltura","html_url":"https://github.com/kaltura","followers_url":"https://api.github.com/users/kaltura/followers","following_url":"https://api.github.com/users/kaltura/following{/other_user}","gists_url":"https://api.github.com/users/kaltura/gists{/gist_id}","starred_url":"https://api.github.com/users/kaltura/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaltura/subscriptions","organizations_url":"https://api.github.com/users/kaltura/orgs","repos_url":"https://api.github.com/users/kaltura/repos","events_url":"https://api.github.com/users/kaltura/events{/privacy}","received_events_url":"https://api.github.com/users/kaltura/received_events","type":"Organization","site_admin":false},"repo":{"id":11364783,"name":"server","full_name":"kaltura/server","owner":{"login":"kaltura","id":319096,"avatar_url":"https://avatars.githubusercontent.com/u/319096?v=3","gravatar_id":"","url":"https://api.github.com/users/kaltura","html_url":"https://github.com/kaltura","followers_url":"https://api.github.com/users/kaltura/followers","following_url":"https://api.github.com/users/kaltura/following{/other_user}","gists_url":"https://api.github.com/users/kaltura/gists{/gist_id}","starred_url":"https://api.github.com/users/kaltura/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaltura/subscriptions","organizations_url":"https://api.github.com/users/kaltura/orgs","repos_url":"https://api.github.com/users/kaltura/repos","events_url":"https://api.github.com/users/kaltura/events{/privacy}","received_events_url":"https://api.github.com/users/kaltura/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kaltura/server","description":"The official Kaltura server. ","fork":false,"url":"https://api.github.com/repos/kaltura/server","forks_url":"https://api.github.com/repos/kaltura/server/forks","keys_url":"https://api.github.com/repos/kaltura/server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kaltura/server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kaltura/server/teams","hooks_url":"https://api.github.com/repos/kaltura/server/hooks","issue_events_url":"https://api.github.com/repos/kaltura/server/issues/events{/number}","events_url":"https://api.github.com/repos/kaltura/server/events","assignees_url":"https://api.github.com/repos/kaltura/server/assignees{/user}","branches_url":"https://api.github.com/repos/kaltura/server/branches{/branch}","tags_url":"https://api.github.com/repos/kaltura/server/tags","blobs_url":"https://api.github.com/repos/kaltura/server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kaltura/server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kaltura/server/git/refs{/sha}","trees_url":"https://api.github.com/repos/kaltura/server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kaltura/server/statuses/{sha}","languages_url":"https://api.github.com/repos/kaltura/server/languages","stargazers_url":"https://api.github.com/repos/kaltura/server/stargazers","contributors_url":"https://api.github.com/repos/kaltura/server/contributors","subscribers_url":"https://api.github.com/repos/kaltura/server/subscribers","subscription_url":"https://api.github.com/repos/kaltura/server/subscription","commits_url":"https://api.github.com/repos/kaltura/server/commits{/sha}","git_commits_url":"https://api.github.com/repos/kaltura/server/git/commits{/sha}","comments_url":"https://api.github.com/repos/kaltura/server/comments{/number}","issue_comment_url":"https://api.github.com/repos/kaltura/server/issues/comments{/number}","contents_url":"https://api.github.com/repos/kaltura/server/contents/{+path}","compare_url":"https://api.github.com/repos/kaltura/server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kaltura/server/merges","archive_url":"https://api.github.com/repos/kaltura/server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kaltura/server/downloads","issues_url":"https://api.github.com/repos/kaltura/server/issues{/number}","pulls_url":"https://api.github.com/repos/kaltura/server/pulls{/number}","milestones_url":"https://api.github.com/repos/kaltura/server/milestones{/number}","notifications_url":"https://api.github.com/repos/kaltura/server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kaltura/server/labels{/name}","releases_url":"https://api.github.com/repos/kaltura/server/releases{/id}","created_at":"2013-07-12T08:59:26Z","updated_at":"2015-11-10T11:49:44Z","pushed_at":"2015-11-24T09:55:05Z","git_url":"git://github.com/kaltura/server.git","ssh_url":"git@github.com:kaltura/server.git","clone_url":"https://github.com/kaltura/server.git","svn_url":"https://github.com/kaltura/server","homepage":"http://www.kaltura.org","size":226097,"stargazers_count":68,"watchers_count":68,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":83,"mirror_url":null,"open_issues_count":85,"forks":83,"open_issues":85,"watchers":68,"default_branch":"Kajam-11.3.0"}},"base":{"label":"kaltura:Kajam-11.3.0","ref":"Kajam-11.3.0","sha":"742131dd807cbf1807aee6d05e20dcb1fd5dd1c1","user":{"login":"kaltura","id":319096,"avatar_url":"https://avatars.githubusercontent.com/u/319096?v=3","gravatar_id":"","url":"https://api.github.com/users/kaltura","html_url":"https://github.com/kaltura","followers_url":"https://api.github.com/users/kaltura/followers","following_url":"https://api.github.com/users/kaltura/following{/other_user}","gists_url":"https://api.github.com/users/kaltura/gists{/gist_id}","starred_url":"https://api.github.com/users/kaltura/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaltura/subscriptions","organizations_url":"https://api.github.com/users/kaltura/orgs","repos_url":"https://api.github.com/users/kaltura/repos","events_url":"https://api.github.com/users/kaltura/events{/privacy}","received_events_url":"https://api.github.com/users/kaltura/received_events","type":"Organization","site_admin":false},"repo":{"id":11364783,"name":"server","full_name":"kaltura/server","owner":{"login":"kaltura","id":319096,"avatar_url":"https://avatars.githubusercontent.com/u/319096?v=3","gravatar_id":"","url":"https://api.github.com/users/kaltura","html_url":"https://github.com/kaltura","followers_url":"https://api.github.com/users/kaltura/followers","following_url":"https://api.github.com/users/kaltura/following{/other_user}","gists_url":"https://api.github.com/users/kaltura/gists{/gist_id}","starred_url":"https://api.github.com/users/kaltura/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaltura/subscriptions","organizations_url":"https://api.github.com/users/kaltura/orgs","repos_url":"https://api.github.com/users/kaltura/repos","events_url":"https://api.github.com/users/kaltura/events{/privacy}","received_events_url":"https://api.github.com/users/kaltura/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kaltura/server","description":"The official Kaltura server. ","fork":false,"url":"https://api.github.com/repos/kaltura/server","forks_url":"https://api.github.com/repos/kaltura/server/forks","keys_url":"https://api.github.com/repos/kaltura/server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kaltura/server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kaltura/server/teams","hooks_url":"https://api.github.com/repos/kaltura/server/hooks","issue_events_url":"https://api.github.com/repos/kaltura/server/issues/events{/number}","events_url":"https://api.github.com/repos/kaltura/server/events","assignees_url":"https://api.github.com/repos/kaltura/server/assignees{/user}","branches_url":"https://api.github.com/repos/kaltura/server/branches{/branch}","tags_url":"https://api.github.com/repos/kaltura/server/tags","blobs_url":"https://api.github.com/repos/kaltura/server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kaltura/server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kaltura/server/git/refs{/sha}","trees_url":"https://api.github.com/repos/kaltura/server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kaltura/server/statuses/{sha}","languages_url":"https://api.github.com/repos/kaltura/server/languages","stargazers_url":"https://api.github.com/repos/kaltura/server/stargazers","contributors_url":"https://api.github.com/repos/kaltura/server/contributors","subscribers_url":"https://api.github.com/repos/kaltura/server/subscribers","subscription_url":"https://api.github.com/repos/kaltura/server/subscription","commits_url":"https://api.github.com/repos/kaltura/server/commits{/sha}","git_commits_url":"https://api.github.com/repos/kaltura/server/git/commits{/sha}","comments_url":"https://api.github.com/repos/kaltura/server/comments{/number}","issue_comment_url":"https://api.github.com/repos/kaltura/server/issues/comments{/number}","contents_url":"https://api.github.com/repos/kaltura/server/contents/{+path}","compare_url":"https://api.github.com/repos/kaltura/server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kaltura/server/merges","archive_url":"https://api.github.com/repos/kaltura/server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kaltura/server/downloads","issues_url":"https://api.github.com/repos/kaltura/server/issues{/number}","pulls_url":"https://api.github.com/repos/kaltura/server/pulls{/number}","milestones_url":"https://api.github.com/repos/kaltura/server/milestones{/number}","notifications_url":"https://api.github.com/repos/kaltura/server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kaltura/server/labels{/name}","releases_url":"https://api.github.com/repos/kaltura/server/releases{/id}","created_at":"2013-07-12T08:59:26Z","updated_at":"2015-11-10T11:49:44Z","pushed_at":"2015-11-24T09:55:05Z","git_url":"git://github.com/kaltura/server.git","ssh_url":"git@github.com:kaltura/server.git","clone_url":"https://github.com/kaltura/server.git","svn_url":"https://github.com/kaltura/server","homepage":"http://www.kaltura.org","size":226097,"stargazers_count":68,"watchers_count":68,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":83,"mirror_url":null,"open_issues_count":85,"forks":83,"open_issues":85,"watchers":68,"default_branch":"Kajam-11.3.0"}},"_links":{"self":{"href":"https://api.github.com/repos/kaltura/server/pulls/3537"},"html":{"href":"https://github.com/kaltura/server/pull/3537"},"issue":{"href":"https://api.github.com/repos/kaltura/server/issues/3537"},"comments":{"href":"https://api.github.com/repos/kaltura/server/issues/3537/comments"},"review_comments":{"href":"https://api.github.com/repos/kaltura/server/pulls/3537/comments"},"review_comment":{"href":"https://api.github.com/repos/kaltura/server/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kaltura/server/pulls/3537/commits"},"statuses":{"href":"https://api.github.com/repos/kaltura/server/statuses/766b3b7394f27df3f26411b24c7d65f4aa2031aa"}}}}