{"action":"created","comment":{"url":"https://api.github.com/repos/FirstLegoLeague/clock/pulls/comments/232463553","pull_request_review_id":173672865,"id":232463553,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMjQ2MzU1Mw==","diff_hunk":"@@ -0,0 +1,29 @@\n+const Promise = require('bluebird')\n+const fs = require('fs')\n+const path = require('path')\n+\n+const writeFile = Promise.promisify(fs.writeFile)\n+const readFile = Promise.promisify(fs.readFile)\n+\n+const DATA_DIR = process.env.DATA_DIR\n+const FILE_NAME = 'timer-start-time.json'\n+\n+exports.TimeSaver = class {\n+  writeTimeToFile (time) {\n+    return writeFile(path.join(DATA_DIR, FILE_NAME), time.getTime())\n+  }\n+\n+  getTimeFromFile () {\n+    return readFile(path.join(DATA_DIR, FILE_NAME), 'utf-8').then(time => {\n+      time = JSON.parse(time)","path":"server/time-saver.js","position":19,"original_position":18,"commit_id":"f525d8a27a6d116c18aa04173d40e70a073dfdb2","original_commit_id":"3d3c2121aa41a3920b2b2d521bc4fc098d1ab6f5","user":{"login":"alanggreen","id":6757517,"node_id":"MDQ6VXNlcjY3NTc1MTc=","avatar_url":"https://avatars1.githubusercontent.com/u/6757517?v=4","gravatar_id":"","url":"https://api.github.com/users/alanggreen","html_url":"https://github.com/alanggreen","followers_url":"https://api.github.com/users/alanggreen/followers","following_url":"https://api.github.com/users/alanggreen/following{/other_user}","gists_url":"https://api.github.com/users/alanggreen/gists{/gist_id}","starred_url":"https://api.github.com/users/alanggreen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alanggreen/subscriptions","organizations_url":"https://api.github.com/users/alanggreen/orgs","repos_url":"https://api.github.com/users/alanggreen/repos","events_url":"https://api.github.com/users/alanggreen/events{/privacy}","received_events_url":"https://api.github.com/users/alanggreen/received_events","type":"User","site_admin":false},"body":"JSON.parse can generate a [Syntax Error exception](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#Exceptions). Suggest to catch and handle, including log.warn","created_at":"2018-11-10T19:37:40Z","updated_at":"2018-11-10T19:52:04Z","html_url":"https://github.com/FirstLegoLeague/clock/pull/44#discussion_r232463553","pull_request_url":"https://api.github.com/repos/FirstLegoLeague/clock/pulls/44","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/FirstLegoLeague/clock/pulls/comments/232463553"},"html":{"href":"https://github.com/FirstLegoLeague/clock/pull/44#discussion_r232463553"},"pull_request":{"href":"https://api.github.com/repos/FirstLegoLeague/clock/pulls/44"}}},"pull_request":{"url":"https://api.github.com/repos/FirstLegoLeague/clock/pulls/44","id":229893355,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI5ODkzMzU1","html_url":"https://github.com/FirstLegoLeague/clock/pull/44","diff_url":"https://github.com/FirstLegoLeague/clock/pull/44.diff","patch_url":"https://github.com/FirstLegoLeague/clock/pull/44.patch","issue_url":"https://api.github.com/repos/FirstLegoLeague/clock/issues/44","number":44,"state":"open","locked":false,"title":"saving time on file, in case of a crash","user":{"login":"taltaub22","id":1567714,"node_id":"MDQ6VXNlcjE1Njc3MTQ=","avatar_url":"https://avatars3.githubusercontent.com/u/1567714?v=4","gravatar_id":"","url":"https://api.github.com/users/taltaub22","html_url":"https://github.com/taltaub22","followers_url":"https://api.github.com/users/taltaub22/followers","following_url":"https://api.github.com/users/taltaub22/following{/other_user}","gists_url":"https://api.github.com/users/taltaub22/gists{/gist_id}","starred_url":"https://api.github.com/users/taltaub22/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taltaub22/subscriptions","organizations_url":"https://api.github.com/users/taltaub22/orgs","repos_url":"https://api.github.com/users/taltaub22/repos","events_url":"https://api.github.com/users/taltaub22/events{/privacy}","received_events_url":"https://api.github.com/users/taltaub22/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-11-10T14:52:31Z","updated_at":"2018-11-10T19:52:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"eefae7e72cc7bdc78c3784996da81b40f6b6fc5b","assignee":null,"assignees":[],"requested_reviewers":[{"login":"2roy999","id":2903801,"node_id":"MDQ6VXNlcjI5MDM4MDE=","avatar_url":"https://avatars0.githubusercontent.com/u/2903801?v=4","gravatar_id":"","url":"https://api.github.com/users/2roy999","html_url":"https://github.com/2roy999","followers_url":"https://api.github.com/users/2roy999/followers","following_url":"https://api.github.com/users/2roy999/following{/other_user}","gists_url":"https://api.github.com/users/2roy999/gists{/gist_id}","starred_url":"https://api.github.com/users/2roy999/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/2roy999/subscriptions","organizations_url":"https://api.github.com/users/2roy999/orgs","repos_url":"https://api.github.com/users/2roy999/repos","events_url":"https://api.github.com/users/2roy999/events{/privacy}","received_events_url":"https://api.github.com/users/2roy999/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/FirstLegoLeague/clock/pulls/44/commits","review_comments_url":"https://api.github.com/repos/FirstLegoLeague/clock/pulls/44/comments","review_comment_url":"https://api.github.com/repos/FirstLegoLeague/clock/pulls/comments{/number}","comments_url":"https://api.github.com/repos/FirstLegoLeague/clock/issues/44/comments","statuses_url":"https://api.github.com/repos/FirstLegoLeague/clock/statuses/f525d8a27a6d116c18aa04173d40e70a073dfdb2","head":{"label":"FirstLegoLeague:saving-time","ref":"saving-time","sha":"f525d8a27a6d116c18aa04173d40e70a073dfdb2","user":{"login":"FirstLegoLeague","id":4487929,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ0ODc5Mjk=","avatar_url":"https://avatars3.githubusercontent.com/u/4487929?v=4","gravatar_id":"","url":"https://api.github.com/users/FirstLegoLeague","html_url":"https://github.com/FirstLegoLeague","followers_url":"https://api.github.com/users/FirstLegoLeague/followers","following_url":"https://api.github.com/users/FirstLegoLeague/following{/other_user}","gists_url":"https://api.github.com/users/FirstLegoLeague/gists{/gist_id}","starred_url":"https://api.github.com/users/FirstLegoLeague/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FirstLegoLeague/subscriptions","organizations_url":"https://api.github.com/users/FirstLegoLeague/orgs","repos_url":"https://api.github.com/users/FirstLegoLeague/repos","events_url":"https://api.github.com/users/FirstLegoLeague/events{/privacy}","received_events_url":"https://api.github.com/users/FirstLegoLeague/received_events","type":"Organization","site_admin":false},"repo":{"id":13188694,"node_id":"MDEwOlJlcG9zaXRvcnkxMzE4ODY5NA==","name":"clock","full_name":"FirstLegoLeague/clock","private":false,"owner":{"login":"FirstLegoLeague","id":4487929,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ0ODc5Mjk=","avatar_url":"https://avatars3.githubusercontent.com/u/4487929?v=4","gravatar_id":"","url":"https://api.github.com/users/FirstLegoLeague","html_url":"https://github.com/FirstLegoLeague","followers_url":"https://api.github.com/users/FirstLegoLeague/followers","following_url":"https://api.github.com/users/FirstLegoLeague/following{/other_user}","gists_url":"https://api.github.com/users/FirstLegoLeague/gists{/gist_id}","starred_url":"https://api.github.com/users/FirstLegoLeague/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FirstLegoLeague/subscriptions","organizations_url":"https://api.github.com/users/FirstLegoLeague/orgs","repos_url":"https://api.github.com/users/FirstLegoLeague/repos","events_url":"https://api.github.com/users/FirstLegoLeague/events{/privacy}","received_events_url":"https://api.github.com/users/FirstLegoLeague/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/FirstLegoLeague/clock","description":"Countdown clock for competition area","fork":false,"url":"https://api.github.com/repos/FirstLegoLeague/clock","forks_url":"https://api.github.com/repos/FirstLegoLeague/clock/forks","keys_url":"https://api.github.com/repos/FirstLegoLeague/clock/keys{/key_id}","collaborators_url":"https://api.github.com/repos/FirstLegoLeague/clock/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/FirstLegoLeague/clock/teams","hooks_url":"https://api.github.com/repos/FirstLegoLeague/clock/hooks","issue_events_url":"https://api.github.com/repos/FirstLegoLeague/clock/issues/events{/number}","events_url":"https://api.github.com/repos/FirstLegoLeague/clock/events","assignees_url":"https://api.github.com/repos/FirstLegoLeague/clock/assignees{/user}","branches_url":"https://api.github.com/repos/FirstLegoLeague/clock/branches{/branch}","tags_url":"https://api.github.com/repos/FirstLegoLeague/clock/tags","blobs_url":"https://api.github.com/repos/FirstLegoLeague/clock/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/FirstLegoLeague/clock/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/FirstLegoLeague/clock/git/refs{/sha}","trees_url":"https://api.github.com/repos/FirstLegoLeague/clock/git/trees{/sha}","statuses_url":"https://api.github.com/repos/FirstLegoLeague/clock/statuses/{sha}","languages_url":"https://api.github.com/repos/FirstLegoLeague/clock/languages","stargazers_url":"https://api.github.com/repos/FirstLegoLeague/clock/stargazers","contributors_url":"https://api.github.com/repos/FirstLegoLeague/clock/contributors","subscribers_url":"https://api.github.com/repos/FirstLegoLeague/clock/subscribers","subscription_url":"https://api.github.com/repos/FirstLegoLeague/clock/subscription","commits_url":"https://api.github.com/repos/FirstLegoLeague/clock/commits{/sha}","git_commits_url":"https://api.github.com/repos/FirstLegoLeague/clock/git/commits{/sha}","comments_url":"https://api.github.com/repos/FirstLegoLeague/clock/comments{/number}","issue_comment_url":"https://api.github.com/repos/FirstLegoLeague/clock/issues/comments{/number}","contents_url":"https://api.github.com/repos/FirstLegoLeague/clock/contents/{+path}","compare_url":"https://api.github.com/repos/FirstLegoLeague/clock/compare/{base}...{head}","merges_url":"https://api.github.com/repos/FirstLegoLeague/clock/merges","archive_url":"https://api.github.com/repos/FirstLegoLeague/clock/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/FirstLegoLeague/clock/downloads","issues_url":"https://api.github.com/repos/FirstLegoLeague/clock/issues{/number}","pulls_url":"https://api.github.com/repos/FirstLegoLeague/clock/pulls{/number}","milestones_url":"https://api.github.com/repos/FirstLegoLeague/clock/milestones{/number}","notifications_url":"https://api.github.com/repos/FirstLegoLeague/clock/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/FirstLegoLeague/clock/labels{/name}","releases_url":"https://api.github.com/repos/FirstLegoLeague/clock/releases{/id}","deployments_url":"https://api.github.com/repos/FirstLegoLeague/clock/deployments","created_at":"2013-09-29T07:47:22Z","updated_at":"2018-11-09T12:45:01Z","pushed_at":"2018-11-10T17:34:39Z","git_url":"git://github.com/FirstLegoLeague/clock.git","ssh_url":"git@github.com:FirstLegoLeague/clock.git","clone_url":"https://github.com/FirstLegoLeague/clock.git","svn_url":"https://github.com/FirstLegoLeague/clock","homepage":"http://firstlegoleague.github.io/clock/","size":17006,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":9,"mirror_url":null,"archived":false,"open_issues_count":15,"license":null,"forks":9,"open_issues":15,"watchers":0,"default_branch":"master"}},"base":{"label":"FirstLegoLeague:master","ref":"master","sha":"4256c7a249c9eb567054504ed1e045c3cd151924","user":{"login":"FirstLegoLeague","id":4487929,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ0ODc5Mjk=","avatar_url":"https://avatars3.githubusercontent.com/u/4487929?v=4","gravatar_id":"","url":"https://api.github.com/users/FirstLegoLeague","html_url":"https://github.com/FirstLegoLeague","followers_url":"https://api.github.com/users/FirstLegoLeague/followers","following_url":"https://api.github.com/users/FirstLegoLeague/following{/other_user}","gists_url":"https://api.github.com/users/FirstLegoLeague/gists{/gist_id}","starred_url":"https://api.github.com/users/FirstLegoLeague/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FirstLegoLeague/subscriptions","organizations_url":"https://api.github.com/users/FirstLegoLeague/orgs","repos_url":"https://api.github.com/users/FirstLegoLeague/repos","events_url":"https://api.github.com/users/FirstLegoLeague/events{/privacy}","received_events_url":"https://api.github.com/users/FirstLegoLeague/received_events","type":"Organization","site_admin":false},"repo":{"id":13188694,"node_id":"MDEwOlJlcG9zaXRvcnkxMzE4ODY5NA==","name":"clock","full_name":"FirstLegoLeague/clock","private":false,"owner":{"login":"FirstLegoLeague","id":4487929,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ0ODc5Mjk=","avatar_url":"https://avatars3.githubusercontent.com/u/4487929?v=4","gravatar_id":"","url":"https://api.github.com/users/FirstLegoLeague","html_url":"https://github.com/FirstLegoLeague","followers_url":"https://api.github.com/users/FirstLegoLeague/followers","following_url":"https://api.github.com/users/FirstLegoLeague/following{/other_user}","gists_url":"https://api.github.com/users/FirstLegoLeague/gists{/gist_id}","starred_url":"https://api.github.com/users/FirstLegoLeague/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FirstLegoLeague/subscriptions","organizations_url":"https://api.github.com/users/FirstLegoLeague/orgs","repos_url":"https://api.github.com/users/FirstLegoLeague/repos","events_url":"https://api.github.com/users/FirstLegoLeague/events{/privacy}","received_events_url":"https://api.github.com/users/FirstLegoLeague/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/FirstLegoLeague/clock","description":"Countdown clock for competition area","fork":false,"url":"https://api.github.com/repos/FirstLegoLeague/clock","forks_url":"https://api.github.com/repos/FirstLegoLeague/clock/forks","keys_url":"https://api.github.com/repos/FirstLegoLeague/clock/keys{/key_id}","collaborators_url":"https://api.github.com/repos/FirstLegoLeague/clock/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/FirstLegoLeague/clock/teams","hooks_url":"https://api.github.com/repos/FirstLegoLeague/clock/hooks","issue_events_url":"https://api.github.com/repos/FirstLegoLeague/clock/issues/events{/number}","events_url":"https://api.github.com/repos/FirstLegoLeague/clock/events","assignees_url":"https://api.github.com/repos/FirstLegoLeague/clock/assignees{/user}","branches_url":"https://api.github.com/repos/FirstLegoLeague/clock/branches{/branch}","tags_url":"https://api.github.com/repos/FirstLegoLeague/clock/tags","blobs_url":"https://api.github.com/repos/FirstLegoLeague/clock/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/FirstLegoLeague/clock/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/FirstLegoLeague/clock/git/refs{/sha}","trees_url":"https://api.github.com/repos/FirstLegoLeague/clock/git/trees{/sha}","statuses_url":"https://api.github.com/repos/FirstLegoLeague/clock/statuses/{sha}","languages_url":"https://api.github.com/repos/FirstLegoLeague/clock/languages","stargazers_url":"https://api.github.com/repos/FirstLegoLeague/clock/stargazers","contributors_url":"https://api.github.com/repos/FirstLegoLeague/clock/contributors","subscribers_url":"https://api.github.com/repos/FirstLegoLeague/clock/subscribers","subscription_url":"https://api.github.com/repos/FirstLegoLeague/clock/subscription","commits_url":"https://api.github.com/repos/FirstLegoLeague/clock/commits{/sha}","git_commits_url":"https://api.github.com/repos/FirstLegoLeague/clock/git/commits{/sha}","comments_url":"https://api.github.com/repos/FirstLegoLeague/clock/comments{/number}","issue_comment_url":"https://api.github.com/repos/FirstLegoLeague/clock/issues/comments{/number}","contents_url":"https://api.github.com/repos/FirstLegoLeague/clock/contents/{+path}","compare_url":"https://api.github.com/repos/FirstLegoLeague/clock/compare/{base}...{head}","merges_url":"https://api.github.com/repos/FirstLegoLeague/clock/merges","archive_url":"https://api.github.com/repos/FirstLegoLeague/clock/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/FirstLegoLeague/clock/downloads","issues_url":"https://api.github.com/repos/FirstLegoLeague/clock/issues{/number}","pulls_url":"https://api.github.com/repos/FirstLegoLeague/clock/pulls{/number}","milestones_url":"https://api.github.com/repos/FirstLegoLeague/clock/milestones{/number}","notifications_url":"https://api.github.com/repos/FirstLegoLeague/clock/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/FirstLegoLeague/clock/labels{/name}","releases_url":"https://api.github.com/repos/FirstLegoLeague/clock/releases{/id}","deployments_url":"https://api.github.com/repos/FirstLegoLeague/clock/deployments","created_at":"2013-09-29T07:47:22Z","updated_at":"2018-11-09T12:45:01Z","pushed_at":"2018-11-10T17:34:39Z","git_url":"git://github.com/FirstLegoLeague/clock.git","ssh_url":"git@github.com:FirstLegoLeague/clock.git","clone_url":"https://github.com/FirstLegoLeague/clock.git","svn_url":"https://github.com/FirstLegoLeague/clock","homepage":"http://firstlegoleague.github.io/clock/","size":17006,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":9,"mirror_url":null,"archived":false,"open_issues_count":15,"license":null,"forks":9,"open_issues":15,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/FirstLegoLeague/clock/pulls/44"},"html":{"href":"https://github.com/FirstLegoLeague/clock/pull/44"},"issue":{"href":"https://api.github.com/repos/FirstLegoLeague/clock/issues/44"},"comments":{"href":"https://api.github.com/repos/FirstLegoLeague/clock/issues/44/comments"},"review_comments":{"href":"https://api.github.com/repos/FirstLegoLeague/clock/pulls/44/comments"},"review_comment":{"href":"https://api.github.com/repos/FirstLegoLeague/clock/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/FirstLegoLeague/clock/pulls/44/commits"},"statuses":{"href":"https://api.github.com/repos/FirstLegoLeague/clock/statuses/f525d8a27a6d116c18aa04173d40e70a073dfdb2"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"alanggreen"}}