{"action":"created","comment":{"url":"https://api.github.com/repos/dasein-cloud/dasein-cloud-digitalocean/pulls/comments/36502405","id":36502405,"diff_hunk":"@@ -320,27 +358,36 @@ public boolean isSubscribed() throws InternalException, CloudException {\n     @Override\n     public @Nonnull Iterable<ResourceStatus> listVirtualMachineStatus() throws InternalException, CloudException {\n         APITrace.begin(getProvider(), \"listVirtualMachineStatus\");\n+\n+        Cache<ResourceStatus> cache = Cache.getInstance(getProvider(), \"vm-status-list\", ResourceStatus.class, CacheLevel.CLOUD_ACCOUNT, new TimePeriod<Second>(60, TimePeriod.SECOND) );\n+        Collection<ResourceStatus> resourceStatus = ( Collection<ResourceStatus> ) cache.get(getContext());\n+\n         try {\n-            List<ResourceStatus> results = new ArrayList<ResourceStatus>();\n-            Droplets droplets = (Droplets)DigitalOceanModelFactory.getModel(getProvider(), org.dasein.cloud.digitalocean.models.rest.DigitalOcean.DROPLETS );\n-            int page = 1;\n-            int total = droplets.getTotal();\n-            while( droplets.getDroplets().size() > 0 ) {\n-                for( Droplet d : droplets.getDroplets() ) {\n-                    ResourceStatus status = toStatus(d);\n-                    if( status != null ) {\n-                        results.add(status);\n+            if (resourceStatus != null) {\n+                return resourceStatus;\n+            } else {","path":"src/main/java/org/dasein/cloud/digitalocean/compute/DOInstance.java","position":125,"original_position":125,"commit_id":"8095f75bcc26c3455de1b1c7e2d64a53de44fff0","original_commit_id":"8095f75bcc26c3455de1b1c7e2d64a53de44fff0","user":{"login":"maksimov","id":157861,"avatar_url":"https://avatars.githubusercontent.com/u/157861?v=3","gravatar_id":"","url":"https://api.github.com/users/maksimov","html_url":"https://github.com/maksimov","followers_url":"https://api.github.com/users/maksimov/followers","following_url":"https://api.github.com/users/maksimov/following{/other_user}","gists_url":"https://api.github.com/users/maksimov/gists{/gist_id}","starred_url":"https://api.github.com/users/maksimov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maksimov/subscriptions","organizations_url":"https://api.github.com/users/maksimov/orgs","repos_url":"https://api.github.com/users/maksimov/repos","events_url":"https://api.github.com/users/maksimov/events{/privacy}","received_events_url":"https://api.github.com/users/maksimov/received_events","type":"User","site_admin":false},"body":"No need for an `else` here. ","created_at":"2015-08-07T09:07:14Z","updated_at":"2015-08-07T09:07:14Z","html_url":"https://github.com/dasein-cloud/dasein-cloud-digitalocean/pull/5#discussion_r36502405","pull_request_url":"https://api.github.com/repos/dasein-cloud/dasein-cloud-digitalocean/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/dasein-cloud/dasein-cloud-digitalocean/pulls/comments/36502405"},"html":{"href":"https://github.com/dasein-cloud/dasein-cloud-digitalocean/pull/5#discussion_r36502405"},"pull_request":{"href":"https://api.github.com/repos/dasein-cloud/dasein-cloud-digitalocean/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/dasein-cloud/dasein-cloud-digitalocean/pulls/5","id":41846779,"html_url":"https://github.com/dasein-cloud/dasein-cloud-digitalocean/pull/5","diff_url":"https://github.com/dasein-cloud/dasein-cloud-digitalocean/pull/5.diff","patch_url":"https://github.com/dasein-cloud/dasein-cloud-digitalocean/pull/5.patch","issue_url":"https://api.github.com/repos/dasein-cloud/dasein-cloud-digitalocean/issues/5","number":5,"state":"open","locked":false,"title":"2015.06 2","user":{"login":"unwin","id":515346,"avatar_url":"https://avatars.githubusercontent.com/u/515346?v=3","gravatar_id":"","url":"https://api.github.com/users/unwin","html_url":"https://github.com/unwin","followers_url":"https://api.github.com/users/unwin/followers","following_url":"https://api.github.com/users/unwin/following{/other_user}","gists_url":"https://api.github.com/users/unwin/gists{/gist_id}","starred_url":"https://api.github.com/users/unwin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unwin/subscriptions","organizations_url":"https://api.github.com/users/unwin/orgs","repos_url":"https://api.github.com/users/unwin/repos","events_url":"https://api.github.com/users/unwin/events{/privacy}","received_events_url":"https://api.github.com/users/unwin/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-08-06T23:35:55Z","updated_at":"2015-08-07T09:07:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2b4aedec2f73d91720afebe8923ba7f19af7ef48","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dasein-cloud/dasein-cloud-digitalocean/pulls/5/commits","review_comments_url":"https://api.github.com/repos/dasein-cloud/dasein-cloud-digitalocean/pulls/5/comments","review_comment_url":"https://api.github.com/repos/dasein-cloud/dasein-cloud-digitalocean/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dasein-cloud/dasein-cloud-digitalocean/issues/5/comments","statuses_url":"https://api.github.com/repos/dasein-cloud/dasein-cloud-digitalocean/statuses/8095f75bcc26c3455de1b1c7e2d64a53de44fff0","head":{"label":"unwin:2015.06-2","ref":"2015.06-2","sha":"8095f75bcc26c3455de1b1c7e2d64a53de44fff0","user":{"login":"unwin","id":515346,"avatar_url":"https://avatars.githubusercontent.com/u/515346?v=3","gravatar_id":"","url":"https://api.github.com/users/unwin","html_url":"https://github.com/unwin","followers_url":"https://api.github.com/users/unwin/followers","following_url":"https://api.github.com/users/unwin/following{/other_user}","gists_url":"https://api.github.com/users/unwin/gists{/gist_id}","starred_url":"https://api.github.com/users/unwin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unwin/subscriptions","organizations_url":"https://api.github.com/users/unwin/orgs","repos_url":"https://api.github.com/users/unwin/repos","events_url":"https://api.github.com/users/unwin/events{/privacy}","received_events_url":"https://api.github.com/users/unwin/received_events","type":"User","site_admin":false},"repo":{"id":40213632,"name":"dasein-cloud-digitalocean","full_name":"unwin/dasein-cloud-digitalocean","owner":{"login":"unwin","id":515346,"avatar_url":"https://avatars.githubusercontent.com/u/515346?v=3","gravatar_id":"","url":"https://api.github.com/users/unwin","html_url":"https://github.com/unwin","followers_url":"https://api.github.com/users/unwin/followers","following_url":"https://api.github.com/users/unwin/following{/other_user}","gists_url":"https://api.github.com/users/unwin/gists{/gist_id}","starred_url":"https://api.github.com/users/unwin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unwin/subscriptions","organizations_url":"https://api.github.com/users/unwin/orgs","repos_url":"https://api.github.com/users/unwin/repos","events_url":"https://api.github.com/users/unwin/events{/privacy}","received_events_url":"https://api.github.com/users/unwin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/unwin/dasein-cloud-digitalocean","description":null,"fork":true,"url":"https://api.github.com/repos/unwin/dasein-cloud-digitalocean","forks_url":"https://api.github.com/repos/unwin/dasein-cloud-digitalocean/forks","keys_url":"https://api.github.com/repos/unwin/dasein-cloud-digitalocean/keys{/key_id}","collaborators_url":"https://api.github.com/repos/unwin/dasein-cloud-digitalocean/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/unwin/dasein-cloud-digitalocean/teams","hooks_url":"https://api.github.com/repos/unwin/dasein-cloud-digitalocean/hooks","issue_events_url":"https://api.github.com/repos/unwin/dasein-cloud-digitalocean/issues/events{/number}","events_url":"https://api.github.com/repos/unwin/dasein-cloud-digitalocean/events","assignees_url":"https://api.github.com/repos/unwin/dasein-cloud-digitalocean/assignees{/user}","branches_url":"https://api.github.com/repos/unwin/dasein-cloud-digitalocean/branches{/branch}","tags_url":"https://api.github.com/repos/unwin/dasein-cloud-digitalocean/tags","blobs_url":"https://api.github.com/repos/unwin/dasein-cloud-digitalocean/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/unwin/dasein-cloud-digitalocean/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/unwin/dasein-cloud-digitalocean/git/refs{/sha}","trees_url":"https://api.github.com/repos/unwin/dasein-cloud-digitalocean/git/trees{/sha}","statuses_url":"https://api.github.com/repos/unwin/dasein-cloud-digitalocean/statuses/{sha}","languages_url":"https://api.github.com/repos/unwin/dasein-cloud-digitalocean/languages","stargazers_url":"https://api.github.com/repos/unwin/dasein-cloud-digitalocean/stargazers","contributors_url":"https://api.github.com/repos/unwin/dasein-cloud-digitalocean/contributors","subscribers_url":"https://api.github.com/repos/unwin/dasein-cloud-digitalocean/subscribers","subscription_url":"https://api.github.com/repos/unwin/dasein-cloud-digitalocean/subscription","commits_url":"https://api.github.com/repos/unwin/dasein-cloud-digitalocean/commits{/sha}","git_commits_url":"https://api.github.com/repos/unwin/dasein-cloud-digitalocean/git/commits{/sha}","comments_url":"https://api.github.com/repos/unwin/dasein-cloud-digitalocean/comments{/number}","issue_comment_url":"https://api.github.com/repos/unwin/dasein-cloud-digitalocean/issues/comments{/number}","contents_url":"https://api.github.com/repos/unwin/dasein-cloud-digitalocean/contents/{+path}","compare_url":"https://api.github.com/repos/unwin/dasein-cloud-digitalocean/compare/{base}...{head}","merges_url":"https://api.github.com/repos/unwin/dasein-cloud-digitalocean/merges","archive_url":"https://api.github.com/repos/unwin/dasein-cloud-digitalocean/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/unwin/dasein-cloud-digitalocean/downloads","issues_url":"https://api.github.com/repos/unwin/dasein-cloud-digitalocean/issues{/number}","pulls_url":"https://api.github.com/repos/unwin/dasein-cloud-digitalocean/pulls{/number}","milestones_url":"https://api.github.com/repos/unwin/dasein-cloud-digitalocean/milestones{/number}","notifications_url":"https://api.github.com/repos/unwin/dasein-cloud-digitalocean/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/unwin/dasein-cloud-digitalocean/labels{/name}","releases_url":"https://api.github.com/repos/unwin/dasein-cloud-digitalocean/releases{/id}","created_at":"2015-08-04T23:15:37Z","updated_at":"2015-08-04T23:15:38Z","pushed_at":"2015-08-06T23:11:51Z","git_url":"git://github.com/unwin/dasein-cloud-digitalocean.git","ssh_url":"git@github.com:unwin/dasein-cloud-digitalocean.git","clone_url":"https://github.com/unwin/dasein-cloud-digitalocean.git","svn_url":"https://github.com/unwin/dasein-cloud-digitalocean","homepage":null,"size":309,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dasein-cloud:2015.06","ref":"2015.06","sha":"674d0f63b4f93352f11fd6f7c5aff14412b76706","user":{"login":"dasein-cloud","id":10167669,"avatar_url":"https://avatars.githubusercontent.com/u/10167669?v=3","gravatar_id":"","url":"https://api.github.com/users/dasein-cloud","html_url":"https://github.com/dasein-cloud","followers_url":"https://api.github.com/users/dasein-cloud/followers","following_url":"https://api.github.com/users/dasein-cloud/following{/other_user}","gists_url":"https://api.github.com/users/dasein-cloud/gists{/gist_id}","starred_url":"https://api.github.com/users/dasein-cloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dasein-cloud/subscriptions","organizations_url":"https://api.github.com/users/dasein-cloud/orgs","repos_url":"https://api.github.com/users/dasein-cloud/repos","events_url":"https://api.github.com/users/dasein-cloud/events{/privacy}","received_events_url":"https://api.github.com/users/dasein-cloud/received_events","type":"Organization","site_admin":false},"repo":{"id":39010075,"name":"dasein-cloud-digitalocean","full_name":"dasein-cloud/dasein-cloud-digitalocean","owner":{"login":"dasein-cloud","id":10167669,"avatar_url":"https://avatars.githubusercontent.com/u/10167669?v=3","gravatar_id":"","url":"https://api.github.com/users/dasein-cloud","html_url":"https://github.com/dasein-cloud","followers_url":"https://api.github.com/users/dasein-cloud/followers","following_url":"https://api.github.com/users/dasein-cloud/following{/other_user}","gists_url":"https://api.github.com/users/dasein-cloud/gists{/gist_id}","starred_url":"https://api.github.com/users/dasein-cloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dasein-cloud/subscriptions","organizations_url":"https://api.github.com/users/dasein-cloud/orgs","repos_url":"https://api.github.com/users/dasein-cloud/repos","events_url":"https://api.github.com/users/dasein-cloud/events{/privacy}","received_events_url":"https://api.github.com/users/dasein-cloud/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dasein-cloud/dasein-cloud-digitalocean","description":null,"fork":false,"url":"https://api.github.com/repos/dasein-cloud/dasein-cloud-digitalocean","forks_url":"https://api.github.com/repos/dasein-cloud/dasein-cloud-digitalocean/forks","keys_url":"https://api.github.com/repos/dasein-cloud/dasein-cloud-digitalocean/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dasein-cloud/dasein-cloud-digitalocean/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dasein-cloud/dasein-cloud-digitalocean/teams","hooks_url":"https://api.github.com/repos/dasein-cloud/dasein-cloud-digitalocean/hooks","issue_events_url":"https://api.github.com/repos/dasein-cloud/dasein-cloud-digitalocean/issues/events{/number}","events_url":"https://api.github.com/repos/dasein-cloud/dasein-cloud-digitalocean/events","assignees_url":"https://api.github.com/repos/dasein-cloud/dasein-cloud-digitalocean/assignees{/user}","branches_url":"https://api.github.com/repos/dasein-cloud/dasein-cloud-digitalocean/branches{/branch}","tags_url":"https://api.github.com/repos/dasein-cloud/dasein-cloud-digitalocean/tags","blobs_url":"https://api.github.com/repos/dasein-cloud/dasein-cloud-digitalocean/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dasein-cloud/dasein-cloud-digitalocean/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dasein-cloud/dasein-cloud-digitalocean/git/refs{/sha}","trees_url":"https://api.github.com/repos/dasein-cloud/dasein-cloud-digitalocean/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dasein-cloud/dasein-cloud-digitalocean/statuses/{sha}","languages_url":"https://api.github.com/repos/dasein-cloud/dasein-cloud-digitalocean/languages","stargazers_url":"https://api.github.com/repos/dasein-cloud/dasein-cloud-digitalocean/stargazers","contributors_url":"https://api.github.com/repos/dasein-cloud/dasein-cloud-digitalocean/contributors","subscribers_url":"https://api.github.com/repos/dasein-cloud/dasein-cloud-digitalocean/subscribers","subscription_url":"https://api.github.com/repos/dasein-cloud/dasein-cloud-digitalocean/subscription","commits_url":"https://api.github.com/repos/dasein-cloud/dasein-cloud-digitalocean/commits{/sha}","git_commits_url":"https://api.github.com/repos/dasein-cloud/dasein-cloud-digitalocean/git/commits{/sha}","comments_url":"https://api.github.com/repos/dasein-cloud/dasein-cloud-digitalocean/comments{/number}","issue_comment_url":"https://api.github.com/repos/dasein-cloud/dasein-cloud-digitalocean/issues/comments{/number}","contents_url":"https://api.github.com/repos/dasein-cloud/dasein-cloud-digitalocean/contents/{+path}","compare_url":"https://api.github.com/repos/dasein-cloud/dasein-cloud-digitalocean/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dasein-cloud/dasein-cloud-digitalocean/merges","archive_url":"https://api.github.com/repos/dasein-cloud/dasein-cloud-digitalocean/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dasein-cloud/dasein-cloud-digitalocean/downloads","issues_url":"https://api.github.com/repos/dasein-cloud/dasein-cloud-digitalocean/issues{/number}","pulls_url":"https://api.github.com/repos/dasein-cloud/dasein-cloud-digitalocean/pulls{/number}","milestones_url":"https://api.github.com/repos/dasein-cloud/dasein-cloud-digitalocean/milestones{/number}","notifications_url":"https://api.github.com/repos/dasein-cloud/dasein-cloud-digitalocean/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dasein-cloud/dasein-cloud-digitalocean/labels{/name}","releases_url":"https://api.github.com/repos/dasein-cloud/dasein-cloud-digitalocean/releases{/id}","created_at":"2015-07-13T12:13:17Z","updated_at":"2015-07-13T12:13:20Z","pushed_at":"2015-08-06T23:35:55Z","git_url":"git://github.com/dasein-cloud/dasein-cloud-digitalocean.git","ssh_url":"git@github.com:dasein-cloud/dasein-cloud-digitalocean.git","clone_url":"https://github.com/dasein-cloud/dasein-cloud-digitalocean.git","svn_url":"https://github.com/dasein-cloud/dasein-cloud-digitalocean","homepage":null,"size":395,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":1,"forks":3,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dasein-cloud/dasein-cloud-digitalocean/pulls/5"},"html":{"href":"https://github.com/dasein-cloud/dasein-cloud-digitalocean/pull/5"},"issue":{"href":"https://api.github.com/repos/dasein-cloud/dasein-cloud-digitalocean/issues/5"},"comments":{"href":"https://api.github.com/repos/dasein-cloud/dasein-cloud-digitalocean/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/dasein-cloud/dasein-cloud-digitalocean/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/dasein-cloud/dasein-cloud-digitalocean/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dasein-cloud/dasein-cloud-digitalocean/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/dasein-cloud/dasein-cloud-digitalocean/statuses/8095f75bcc26c3455de1b1c7e2d64a53de44fff0"}}}}