{"action":"created","comment":{"url":"https://api.github.com/repos/openaps/oref0/pulls/comments/167444845","pull_request_review_id":95665393,"id":167444845,"diff_hunk":"@@ -152,16 +152,28 @@ function smb_reservoir_before {\n     # Refresh reservoir.json and pumphistory.json\n     try_fail refresh_pumphistory_and_meal\n     try_fail cp monitor/reservoir.json monitor/lastreservoir.json\n+    CURRENT_DTG=$(date +%s)\n     try_fail timerun openaps report invoke monitor/clock.json monitor/clock-zoned.json 2>&3 >&4 | tail -1\n     echo -n \"Checking pump clock: \"\n     (cat monitor/clock-zoned.json; echo) | tr -d '\\n'\n     echo -n \" is within 90s of current time: \" && date\n-    if (( $(bc <<< \"$(date +%s -d $(cat monitor/clock-zoned.json | sed 's/\"//g')) - $(date +%s)\") < -55 )) || (( $(bc <<< \"$(date +%s -d $(cat monitor/clock-zoned.json | sed 's/\"//g')) - $(date +%s)\") > 55 )); then\n-        echo Pump clock is more than 55s off: attempting to reset it\n+    let DTG_DIFFERENCE=$CURRENT_DTG-$(date +%s -d $(cat monitor/clock-zoned.json | sed 's/\"//g'))\n+    DTG_DIFFERENCE=${DTG_DIFFERENCE/#-/}\n+    if [ \"$DTG_DIFFERENCE\" -gt \"90\" ]","path":"bin/oref0-pump-loop.sh","position":13,"original_position":13,"commit_id":"992b8e4b408baa8e55d0d0d732ca335080057b0a","original_commit_id":"992b8e4b408baa8e55d0d0d732ca335080057b0a","user":{"login":"scottleibrand","id":6982790,"avatar_url":"https://avatars1.githubusercontent.com/u/6982790?v=4","gravatar_id":"","url":"https://api.github.com/users/scottleibrand","html_url":"https://github.com/scottleibrand","followers_url":"https://api.github.com/users/scottleibrand/followers","following_url":"https://api.github.com/users/scottleibrand/following{/other_user}","gists_url":"https://api.github.com/users/scottleibrand/gists{/gist_id}","starred_url":"https://api.github.com/users/scottleibrand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scottleibrand/subscriptions","organizations_url":"https://api.github.com/users/scottleibrand/orgs","repos_url":"https://api.github.com/users/scottleibrand/repos","events_url":"https://api.github.com/users/scottleibrand/events{/privacy}","received_events_url":"https://api.github.com/users/scottleibrand/received_events","type":"User","site_admin":false},"body":"This has to be less than 90 to avoid a boundary condition. I chose 55. ","created_at":"2018-02-11T18:50:03Z","updated_at":"2018-02-11T18:50:15Z","html_url":"https://github.com/openaps/oref0/pull/924#discussion_r167444845","pull_request_url":"https://api.github.com/repos/openaps/oref0/pulls/924","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/openaps/oref0/pulls/comments/167444845"},"html":{"href":"https://github.com/openaps/oref0/pull/924#discussion_r167444845"},"pull_request":{"href":"https://api.github.com/repos/openaps/oref0/pulls/924"}}},"pull_request":{"url":"https://api.github.com/repos/openaps/oref0/pulls/924","id":168467291,"html_url":"https://github.com/openaps/oref0/pull/924","diff_url":"https://github.com/openaps/oref0/pull/924.diff","patch_url":"https://github.com/openaps/oref0/pull/924.patch","issue_url":"https://api.github.com/repos/openaps/oref0/issues/924","number":924,"state":"open","locked":false,"title":"Fix handling of dates so that we are not comparing the time the pump-…","user":{"login":"dcacklam","id":29437798,"avatar_url":"https://avatars3.githubusercontent.com/u/29437798?v=4","gravatar_id":"","url":"https://api.github.com/users/dcacklam","html_url":"https://github.com/dcacklam","followers_url":"https://api.github.com/users/dcacklam/followers","following_url":"https://api.github.com/users/dcacklam/following{/other_user}","gists_url":"https://api.github.com/users/dcacklam/gists{/gist_id}","starred_url":"https://api.github.com/users/dcacklam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcacklam/subscriptions","organizations_url":"https://api.github.com/users/dcacklam/orgs","repos_url":"https://api.github.com/users/dcacklam/repos","events_url":"https://api.github.com/users/dcacklam/events{/privacy}","received_events_url":"https://api.github.com/users/dcacklam/received_events","type":"User","site_admin":false},"body":"Fix date-comparison routine so that it captures the date to a variable immediately after pulling the device-clock date, rather than comparing what the clock *was* set to when the json file was written to disk, to the time it is when the test executes. \r\n\r\nThis reduces the number of erroneous pump-set calls when CPU load is high. \r\n\r\nAlso, fix set-device-clocks so that it doesn't try and set the 'clock' on xdrip CGM.\r\n","created_at":"2018-02-11T18:41:12Z","updated_at":"2018-02-11T18:50:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6dc56b18aef9b32197bc6c95106bb57c90069e40","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/openaps/oref0/pulls/924/commits","review_comments_url":"https://api.github.com/repos/openaps/oref0/pulls/924/comments","review_comment_url":"https://api.github.com/repos/openaps/oref0/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openaps/oref0/issues/924/comments","statuses_url":"https://api.github.com/repos/openaps/oref0/statuses/992b8e4b408baa8e55d0d0d732ca335080057b0a","head":{"label":"dcacklam:fix_date_routine","ref":"fix_date_routine","sha":"992b8e4b408baa8e55d0d0d732ca335080057b0a","user":{"login":"dcacklam","id":29437798,"avatar_url":"https://avatars3.githubusercontent.com/u/29437798?v=4","gravatar_id":"","url":"https://api.github.com/users/dcacklam","html_url":"https://github.com/dcacklam","followers_url":"https://api.github.com/users/dcacklam/followers","following_url":"https://api.github.com/users/dcacklam/following{/other_user}","gists_url":"https://api.github.com/users/dcacklam/gists{/gist_id}","starred_url":"https://api.github.com/users/dcacklam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcacklam/subscriptions","organizations_url":"https://api.github.com/users/dcacklam/orgs","repos_url":"https://api.github.com/users/dcacklam/repos","events_url":"https://api.github.com/users/dcacklam/events{/privacy}","received_events_url":"https://api.github.com/users/dcacklam/received_events","type":"User","site_admin":false},"repo":{"id":121153731,"name":"oref0","full_name":"dcacklam/oref0","owner":{"login":"dcacklam","id":29437798,"avatar_url":"https://avatars3.githubusercontent.com/u/29437798?v=4","gravatar_id":"","url":"https://api.github.com/users/dcacklam","html_url":"https://github.com/dcacklam","followers_url":"https://api.github.com/users/dcacklam/followers","following_url":"https://api.github.com/users/dcacklam/following{/other_user}","gists_url":"https://api.github.com/users/dcacklam/gists{/gist_id}","starred_url":"https://api.github.com/users/dcacklam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcacklam/subscriptions","organizations_url":"https://api.github.com/users/dcacklam/orgs","repos_url":"https://api.github.com/users/dcacklam/repos","events_url":"https://api.github.com/users/dcacklam/events{/privacy}","received_events_url":"https://api.github.com/users/dcacklam/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dcacklam/oref0","description":"oref0: The open reference implementation of the OpenAPS reference design.","fork":true,"url":"https://api.github.com/repos/dcacklam/oref0","forks_url":"https://api.github.com/repos/dcacklam/oref0/forks","keys_url":"https://api.github.com/repos/dcacklam/oref0/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dcacklam/oref0/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dcacklam/oref0/teams","hooks_url":"https://api.github.com/repos/dcacklam/oref0/hooks","issue_events_url":"https://api.github.com/repos/dcacklam/oref0/issues/events{/number}","events_url":"https://api.github.com/repos/dcacklam/oref0/events","assignees_url":"https://api.github.com/repos/dcacklam/oref0/assignees{/user}","branches_url":"https://api.github.com/repos/dcacklam/oref0/branches{/branch}","tags_url":"https://api.github.com/repos/dcacklam/oref0/tags","blobs_url":"https://api.github.com/repos/dcacklam/oref0/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dcacklam/oref0/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dcacklam/oref0/git/refs{/sha}","trees_url":"https://api.github.com/repos/dcacklam/oref0/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dcacklam/oref0/statuses/{sha}","languages_url":"https://api.github.com/repos/dcacklam/oref0/languages","stargazers_url":"https://api.github.com/repos/dcacklam/oref0/stargazers","contributors_url":"https://api.github.com/repos/dcacklam/oref0/contributors","subscribers_url":"https://api.github.com/repos/dcacklam/oref0/subscribers","subscription_url":"https://api.github.com/repos/dcacklam/oref0/subscription","commits_url":"https://api.github.com/repos/dcacklam/oref0/commits{/sha}","git_commits_url":"https://api.github.com/repos/dcacklam/oref0/git/commits{/sha}","comments_url":"https://api.github.com/repos/dcacklam/oref0/comments{/number}","issue_comment_url":"https://api.github.com/repos/dcacklam/oref0/issues/comments{/number}","contents_url":"https://api.github.com/repos/dcacklam/oref0/contents/{+path}","compare_url":"https://api.github.com/repos/dcacklam/oref0/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dcacklam/oref0/merges","archive_url":"https://api.github.com/repos/dcacklam/oref0/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dcacklam/oref0/downloads","issues_url":"https://api.github.com/repos/dcacklam/oref0/issues{/number}","pulls_url":"https://api.github.com/repos/dcacklam/oref0/pulls{/number}","milestones_url":"https://api.github.com/repos/dcacklam/oref0/milestones{/number}","notifications_url":"https://api.github.com/repos/dcacklam/oref0/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dcacklam/oref0/labels{/name}","releases_url":"https://api.github.com/repos/dcacklam/oref0/releases{/id}","deployments_url":"https://api.github.com/repos/dcacklam/oref0/deployments","created_at":"2018-02-11T18:29:10Z","updated_at":"2018-02-11T18:29:12Z","pushed_at":"2018-02-11T18:33:47Z","git_url":"git://github.com/dcacklam/oref0.git","ssh_url":"git@github.com:dcacklam/oref0.git","clone_url":"https://github.com/dcacklam/oref0.git","svn_url":"https://github.com/dcacklam/oref0","homepage":"http://www.OpenAPS.org","size":3596,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"openaps:dev","ref":"dev","sha":"d3d6272ae1d95c7186b4190768af5f06ff847ac3","user":{"login":"openaps","id":11914497,"avatar_url":"https://avatars3.githubusercontent.com/u/11914497?v=4","gravatar_id":"","url":"https://api.github.com/users/openaps","html_url":"https://github.com/openaps","followers_url":"https://api.github.com/users/openaps/followers","following_url":"https://api.github.com/users/openaps/following{/other_user}","gists_url":"https://api.github.com/users/openaps/gists{/gist_id}","starred_url":"https://api.github.com/users/openaps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openaps/subscriptions","organizations_url":"https://api.github.com/users/openaps/orgs","repos_url":"https://api.github.com/users/openaps/repos","events_url":"https://api.github.com/users/openaps/events{/privacy}","received_events_url":"https://api.github.com/users/openaps/received_events","type":"Organization","site_admin":false},"repo":{"id":44561719,"name":"oref0","full_name":"openaps/oref0","owner":{"login":"openaps","id":11914497,"avatar_url":"https://avatars3.githubusercontent.com/u/11914497?v=4","gravatar_id":"","url":"https://api.github.com/users/openaps","html_url":"https://github.com/openaps","followers_url":"https://api.github.com/users/openaps/followers","following_url":"https://api.github.com/users/openaps/following{/other_user}","gists_url":"https://api.github.com/users/openaps/gists{/gist_id}","starred_url":"https://api.github.com/users/openaps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openaps/subscriptions","organizations_url":"https://api.github.com/users/openaps/orgs","repos_url":"https://api.github.com/users/openaps/repos","events_url":"https://api.github.com/users/openaps/events{/privacy}","received_events_url":"https://api.github.com/users/openaps/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openaps/oref0","description":"oref0: The open reference implementation of the OpenAPS reference design.","fork":false,"url":"https://api.github.com/repos/openaps/oref0","forks_url":"https://api.github.com/repos/openaps/oref0/forks","keys_url":"https://api.github.com/repos/openaps/oref0/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openaps/oref0/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openaps/oref0/teams","hooks_url":"https://api.github.com/repos/openaps/oref0/hooks","issue_events_url":"https://api.github.com/repos/openaps/oref0/issues/events{/number}","events_url":"https://api.github.com/repos/openaps/oref0/events","assignees_url":"https://api.github.com/repos/openaps/oref0/assignees{/user}","branches_url":"https://api.github.com/repos/openaps/oref0/branches{/branch}","tags_url":"https://api.github.com/repos/openaps/oref0/tags","blobs_url":"https://api.github.com/repos/openaps/oref0/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openaps/oref0/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openaps/oref0/git/refs{/sha}","trees_url":"https://api.github.com/repos/openaps/oref0/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openaps/oref0/statuses/{sha}","languages_url":"https://api.github.com/repos/openaps/oref0/languages","stargazers_url":"https://api.github.com/repos/openaps/oref0/stargazers","contributors_url":"https://api.github.com/repos/openaps/oref0/contributors","subscribers_url":"https://api.github.com/repos/openaps/oref0/subscribers","subscription_url":"https://api.github.com/repos/openaps/oref0/subscription","commits_url":"https://api.github.com/repos/openaps/oref0/commits{/sha}","git_commits_url":"https://api.github.com/repos/openaps/oref0/git/commits{/sha}","comments_url":"https://api.github.com/repos/openaps/oref0/comments{/number}","issue_comment_url":"https://api.github.com/repos/openaps/oref0/issues/comments{/number}","contents_url":"https://api.github.com/repos/openaps/oref0/contents/{+path}","compare_url":"https://api.github.com/repos/openaps/oref0/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openaps/oref0/merges","archive_url":"https://api.github.com/repos/openaps/oref0/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openaps/oref0/downloads","issues_url":"https://api.github.com/repos/openaps/oref0/issues{/number}","pulls_url":"https://api.github.com/repos/openaps/oref0/pulls{/number}","milestones_url":"https://api.github.com/repos/openaps/oref0/milestones{/number}","notifications_url":"https://api.github.com/repos/openaps/oref0/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openaps/oref0/labels{/name}","releases_url":"https://api.github.com/repos/openaps/oref0/releases{/id}","deployments_url":"https://api.github.com/repos/openaps/oref0/deployments","created_at":"2015-10-19T20:22:39Z","updated_at":"2018-02-11T11:13:30Z","pushed_at":"2018-02-11T18:41:12Z","git_url":"git://github.com/openaps/oref0.git","ssh_url":"git@github.com:openaps/oref0.git","clone_url":"https://github.com/openaps/oref0.git","svn_url":"https://github.com/openaps/oref0","homepage":"http://www.OpenAPS.org","size":3596,"stargazers_count":155,"watchers_count":155,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":209,"mirror_url":null,"archived":false,"open_issues_count":61,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":209,"open_issues":61,"watchers":155,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openaps/oref0/pulls/924"},"html":{"href":"https://github.com/openaps/oref0/pull/924"},"issue":{"href":"https://api.github.com/repos/openaps/oref0/issues/924"},"comments":{"href":"https://api.github.com/repos/openaps/oref0/issues/924/comments"},"review_comments":{"href":"https://api.github.com/repos/openaps/oref0/pulls/924/comments"},"review_comment":{"href":"https://api.github.com/repos/openaps/oref0/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openaps/oref0/pulls/924/commits"},"statuses":{"href":"https://api.github.com/repos/openaps/oref0/statuses/992b8e4b408baa8e55d0d0d732ca335080057b0a"}},"author_association":"NONE"}}
{"actor":{"display_login":"scottleibrand"}}