{"action":"created","comment":{"url":"https://api.github.com/repos/alexkahriman/tripple-a-project/pulls/comments/192562604","pull_request_review_id":125369090,"id":192562604,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5MjU2MjYwNA==","diff_hunk":"@@ -25,14 +28,24 @@ public EventUseCase(EventRemoteDao eventRemoteDao, EventLocalDao eventLocalDao)\n         this.eventLocalDao = eventLocalDao;\n     }\n \n-    public Flowable<List<Event>> read() {\n+    public Flowable<List<Event>> sync() {\n         return new Flowable<List<Event>>() {\n             @Override\n             protected void subscribeActual(Subscriber<? super List<Event>> subscriber) {\n                 final List<Event> events = eventRemoteDao.read().blockingGet();\n+                final List<Event> localEvents = readAllLocal().blockingFirst();\n                 subscriber.onNext(events);\n-                for (Event event : events) {\n-                    eventLocalDao.create(event);\n+\n+                if (localEvents.size() < NUMBER_OF_EVENTS_TO_KEEP) {\n+                    for (Event event : events) {\n+                        eventLocalDao.create(event);\n+                    }\n+                } else {\n+                    for (Event event : events) {\n+                        if (checkEventEndDate(event)) {\n+                            eventLocalDao.create(event);","path":"app/src/main/java/com/ftn/trippleaproject/usecase/repository/EventUseCase.java","position":39,"original_position":39,"commit_id":"cd156278dd6d8196ab45bb69d28302a8ab7cccd2","original_commit_id":"cd156278dd6d8196ab45bb69d28302a8ab7cccd2","user":{"login":"alexkahriman","id":15051073,"node_id":"MDQ6VXNlcjE1MDUxMDcz","avatar_url":"https://avatars0.githubusercontent.com/u/15051073?v=4","gravatar_id":"","url":"https://api.github.com/users/alexkahriman","html_url":"https://github.com/alexkahriman","followers_url":"https://api.github.com/users/alexkahriman/followers","following_url":"https://api.github.com/users/alexkahriman/following{/other_user}","gists_url":"https://api.github.com/users/alexkahriman/gists{/gist_id}","starred_url":"https://api.github.com/users/alexkahriman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexkahriman/subscriptions","organizations_url":"https://api.github.com/users/alexkahriman/orgs","repos_url":"https://api.github.com/users/alexkahriman/repos","events_url":"https://api.github.com/users/alexkahriman/events{/privacy}","received_events_url":"https://api.github.com/users/alexkahriman/received_events","type":"User","site_admin":false},"body":"Too much indentation.","created_at":"2018-06-02T15:36:23Z","updated_at":"2018-06-02T15:39:22Z","html_url":"https://github.com/alexkahriman/tripple-a-project/pull/25#discussion_r192562604","pull_request_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/pulls/25","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/alexkahriman/tripple-a-project/pulls/comments/192562604"},"html":{"href":"https://github.com/alexkahriman/tripple-a-project/pull/25#discussion_r192562604"},"pull_request":{"href":"https://api.github.com/repos/alexkahriman/tripple-a-project/pulls/25"}}},"pull_request":{"url":"https://api.github.com/repos/alexkahriman/tripple-a-project/pulls/25","id":192195658,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkyMTk1NjU4","html_url":"https://github.com/alexkahriman/tripple-a-project/pull/25","diff_url":"https://github.com/alexkahriman/tripple-a-project/pull/25.diff","patch_url":"https://github.com/alexkahriman/tripple-a-project/pull/25.patch","issue_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/issues/25","number":25,"state":"open","locked":false,"title":"TAP-9 - JobService for clearing old cache records","user":{"login":"aleksandar94ns","id":22053475,"node_id":"MDQ6VXNlcjIyMDUzNDc1","avatar_url":"https://avatars1.githubusercontent.com/u/22053475?v=4","gravatar_id":"","url":"https://api.github.com/users/aleksandar94ns","html_url":"https://github.com/aleksandar94ns","followers_url":"https://api.github.com/users/aleksandar94ns/followers","following_url":"https://api.github.com/users/aleksandar94ns/following{/other_user}","gists_url":"https://api.github.com/users/aleksandar94ns/gists{/gist_id}","starred_url":"https://api.github.com/users/aleksandar94ns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aleksandar94ns/subscriptions","organizations_url":"https://api.github.com/users/aleksandar94ns/orgs","repos_url":"https://api.github.com/users/aleksandar94ns/repos","events_url":"https://api.github.com/users/aleksandar94ns/events{/privacy}","received_events_url":"https://api.github.com/users/aleksandar94ns/received_events","type":"User","site_admin":false},"body":"This pull request resolves issue #9 \r\n\r\n**Summary :**\r\n- Add delete methods for NewsArticle and Event Daos\r\n- Create Job Service that will run every 24h to clean up excess data\r\n- Call service when user is logged in successfully","created_at":"2018-06-02T12:32:47Z","updated_at":"2018-06-02T15:39:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ab86af66312645fd630dcd2ac9b87b1bd905e47b","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/pulls/25/commits","review_comments_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/pulls/25/comments","review_comment_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/pulls/comments{/number}","comments_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/issues/25/comments","statuses_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/statuses/cd156278dd6d8196ab45bb69d28302a8ab7cccd2","head":{"label":"alexkahriman:TAP-9-impl","ref":"TAP-9-impl","sha":"cd156278dd6d8196ab45bb69d28302a8ab7cccd2","user":{"login":"alexkahriman","id":15051073,"node_id":"MDQ6VXNlcjE1MDUxMDcz","avatar_url":"https://avatars0.githubusercontent.com/u/15051073?v=4","gravatar_id":"","url":"https://api.github.com/users/alexkahriman","html_url":"https://github.com/alexkahriman","followers_url":"https://api.github.com/users/alexkahriman/followers","following_url":"https://api.github.com/users/alexkahriman/following{/other_user}","gists_url":"https://api.github.com/users/alexkahriman/gists{/gist_id}","starred_url":"https://api.github.com/users/alexkahriman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexkahriman/subscriptions","organizations_url":"https://api.github.com/users/alexkahriman/orgs","repos_url":"https://api.github.com/users/alexkahriman/repos","events_url":"https://api.github.com/users/alexkahriman/events{/privacy}","received_events_url":"https://api.github.com/users/alexkahriman/received_events","type":"User","site_admin":false},"repo":{"id":125652289,"node_id":"MDEwOlJlcG9zaXRvcnkxMjU2NTIyODk=","name":"tripple-a-project","full_name":"alexkahriman/tripple-a-project","owner":{"login":"alexkahriman","id":15051073,"node_id":"MDQ6VXNlcjE1MDUxMDcz","avatar_url":"https://avatars0.githubusercontent.com/u/15051073?v=4","gravatar_id":"","url":"https://api.github.com/users/alexkahriman","html_url":"https://github.com/alexkahriman","followers_url":"https://api.github.com/users/alexkahriman/followers","following_url":"https://api.github.com/users/alexkahriman/following{/other_user}","gists_url":"https://api.github.com/users/alexkahriman/gists{/gist_id}","starred_url":"https://api.github.com/users/alexkahriman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexkahriman/subscriptions","organizations_url":"https://api.github.com/users/alexkahriman/orgs","repos_url":"https://api.github.com/users/alexkahriman/repos","events_url":"https://api.github.com/users/alexkahriman/events{/privacy}","received_events_url":"https://api.github.com/users/alexkahriman/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alexkahriman/tripple-a-project","description":null,"fork":false,"url":"https://api.github.com/repos/alexkahriman/tripple-a-project","forks_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/forks","keys_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/teams","hooks_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/hooks","issue_events_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/issues/events{/number}","events_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/events","assignees_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/assignees{/user}","branches_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/branches{/branch}","tags_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/tags","blobs_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/git/refs{/sha}","trees_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/statuses/{sha}","languages_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/languages","stargazers_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/stargazers","contributors_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/contributors","subscribers_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/subscribers","subscription_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/subscription","commits_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/commits{/sha}","git_commits_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/git/commits{/sha}","comments_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/comments{/number}","issue_comment_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/issues/comments{/number}","contents_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/contents/{+path}","compare_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/merges","archive_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/downloads","issues_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/issues{/number}","pulls_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/pulls{/number}","milestones_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/milestones{/number}","notifications_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/labels{/name}","releases_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/releases{/id}","deployments_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/deployments","created_at":"2018-03-17T17:16:30Z","updated_at":"2018-03-25T17:13:04Z","pushed_at":"2018-06-02T15:32:54Z","git_url":"git://github.com/alexkahriman/tripple-a-project.git","ssh_url":"git@github.com:alexkahriman/tripple-a-project.git","clone_url":"https://github.com/alexkahriman/tripple-a-project.git","svn_url":"https://github.com/alexkahriman/tripple-a-project","homepage":null,"size":657,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":7,"license":null,"forks":0,"open_issues":7,"watchers":0,"default_branch":"master"}},"base":{"label":"alexkahriman:development","ref":"development","sha":"415ba562ec511e8b209e316919fb8943db6c9225","user":{"login":"alexkahriman","id":15051073,"node_id":"MDQ6VXNlcjE1MDUxMDcz","avatar_url":"https://avatars0.githubusercontent.com/u/15051073?v=4","gravatar_id":"","url":"https://api.github.com/users/alexkahriman","html_url":"https://github.com/alexkahriman","followers_url":"https://api.github.com/users/alexkahriman/followers","following_url":"https://api.github.com/users/alexkahriman/following{/other_user}","gists_url":"https://api.github.com/users/alexkahriman/gists{/gist_id}","starred_url":"https://api.github.com/users/alexkahriman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexkahriman/subscriptions","organizations_url":"https://api.github.com/users/alexkahriman/orgs","repos_url":"https://api.github.com/users/alexkahriman/repos","events_url":"https://api.github.com/users/alexkahriman/events{/privacy}","received_events_url":"https://api.github.com/users/alexkahriman/received_events","type":"User","site_admin":false},"repo":{"id":125652289,"node_id":"MDEwOlJlcG9zaXRvcnkxMjU2NTIyODk=","name":"tripple-a-project","full_name":"alexkahriman/tripple-a-project","owner":{"login":"alexkahriman","id":15051073,"node_id":"MDQ6VXNlcjE1MDUxMDcz","avatar_url":"https://avatars0.githubusercontent.com/u/15051073?v=4","gravatar_id":"","url":"https://api.github.com/users/alexkahriman","html_url":"https://github.com/alexkahriman","followers_url":"https://api.github.com/users/alexkahriman/followers","following_url":"https://api.github.com/users/alexkahriman/following{/other_user}","gists_url":"https://api.github.com/users/alexkahriman/gists{/gist_id}","starred_url":"https://api.github.com/users/alexkahriman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexkahriman/subscriptions","organizations_url":"https://api.github.com/users/alexkahriman/orgs","repos_url":"https://api.github.com/users/alexkahriman/repos","events_url":"https://api.github.com/users/alexkahriman/events{/privacy}","received_events_url":"https://api.github.com/users/alexkahriman/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alexkahriman/tripple-a-project","description":null,"fork":false,"url":"https://api.github.com/repos/alexkahriman/tripple-a-project","forks_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/forks","keys_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/teams","hooks_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/hooks","issue_events_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/issues/events{/number}","events_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/events","assignees_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/assignees{/user}","branches_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/branches{/branch}","tags_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/tags","blobs_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/git/refs{/sha}","trees_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/statuses/{sha}","languages_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/languages","stargazers_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/stargazers","contributors_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/contributors","subscribers_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/subscribers","subscription_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/subscription","commits_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/commits{/sha}","git_commits_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/git/commits{/sha}","comments_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/comments{/number}","issue_comment_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/issues/comments{/number}","contents_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/contents/{+path}","compare_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/merges","archive_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/downloads","issues_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/issues{/number}","pulls_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/pulls{/number}","milestones_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/milestones{/number}","notifications_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/labels{/name}","releases_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/releases{/id}","deployments_url":"https://api.github.com/repos/alexkahriman/tripple-a-project/deployments","created_at":"2018-03-17T17:16:30Z","updated_at":"2018-03-25T17:13:04Z","pushed_at":"2018-06-02T15:32:54Z","git_url":"git://github.com/alexkahriman/tripple-a-project.git","ssh_url":"git@github.com:alexkahriman/tripple-a-project.git","clone_url":"https://github.com/alexkahriman/tripple-a-project.git","svn_url":"https://github.com/alexkahriman/tripple-a-project","homepage":null,"size":657,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":7,"license":null,"forks":0,"open_issues":7,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/alexkahriman/tripple-a-project/pulls/25"},"html":{"href":"https://github.com/alexkahriman/tripple-a-project/pull/25"},"issue":{"href":"https://api.github.com/repos/alexkahriman/tripple-a-project/issues/25"},"comments":{"href":"https://api.github.com/repos/alexkahriman/tripple-a-project/issues/25/comments"},"review_comments":{"href":"https://api.github.com/repos/alexkahriman/tripple-a-project/pulls/25/comments"},"review_comment":{"href":"https://api.github.com/repos/alexkahriman/tripple-a-project/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/alexkahriman/tripple-a-project/pulls/25/commits"},"statuses":{"href":"https://api.github.com/repos/alexkahriman/tripple-a-project/statuses/cd156278dd6d8196ab45bb69d28302a8ab7cccd2"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"alexkahriman"}}