{"action":"created","issue":{"url":"https://api.github.com/repos/rails/sprockets/issues/211","repository_url":"https://api.github.com/repos/rails/sprockets","labels_url":"https://api.github.com/repos/rails/sprockets/issues/211/labels{/name}","comments_url":"https://api.github.com/repos/rails/sprockets/issues/211/comments","events_url":"https://api.github.com/repos/rails/sprockets/issues/211/events","html_url":"https://github.com/rails/sprockets/pull/211","id":125004653,"number":211,"title":"FileStore: find caches and compute size only when needed","user":{"login":"TimPetricola","id":674084,"avatar_url":"https://avatars.githubusercontent.com/u/674084?v=3","gravatar_id":"","url":"https://api.github.com/users/TimPetricola","html_url":"https://github.com/TimPetricola","followers_url":"https://api.github.com/users/TimPetricola/followers","following_url":"https://api.github.com/users/TimPetricola/following{/other_user}","gists_url":"https://api.github.com/users/TimPetricola/gists{/gist_id}","starred_url":"https://api.github.com/users/TimPetricola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TimPetricola/subscriptions","organizations_url":"https://api.github.com/users/TimPetricola/orgs","repos_url":"https://api.github.com/users/TimPetricola/repos","events_url":"https://api.github.com/users/TimPetricola/events{/privacy}","received_events_url":"https://api.github.com/users/TimPetricola/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"rafaelfranca","id":47848,"avatar_url":"https://avatars.githubusercontent.com/u/47848?v=3","gravatar_id":"","url":"https://api.github.com/users/rafaelfranca","html_url":"https://github.com/rafaelfranca","followers_url":"https://api.github.com/users/rafaelfranca/followers","following_url":"https://api.github.com/users/rafaelfranca/following{/other_user}","gists_url":"https://api.github.com/users/rafaelfranca/gists{/gist_id}","starred_url":"https://api.github.com/users/rafaelfranca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rafaelfranca/subscriptions","organizations_url":"https://api.github.com/users/rafaelfranca/orgs","repos_url":"https://api.github.com/users/rafaelfranca/repos","events_url":"https://api.github.com/users/rafaelfranca/events{/privacy}","received_events_url":"https://api.github.com/users/rafaelfranca/received_events","type":"User","site_admin":false},"milestone":null,"comments":6,"created_at":"2016-01-05T16:48:04Z","updated_at":"2016-06-08T02:44:43Z","closed_at":"2016-01-06T00:20:03Z","pull_request":{"url":"https://api.github.com/repos/rails/sprockets/pulls/211","html_url":"https://github.com/rails/sprockets/pull/211","diff_url":"https://github.com/rails/sprockets/pull/211.diff","patch_url":"https://github.com/rails/sprockets/pull/211.patch"},"body":"At the moment, `FileStore` finds all cache files to get the size at initialization. This operation can be heavy and is not necessarily needed.\r\n\r\nAs an example, `sprockets-rails` [always initializes](https://github.com/rails/sprockets-rails/blob/master/lib/sprockets/railtie.rb#L100-L104)  a `FileStore` and lets apps override it later:\r\n\r\n```rb\r\nmodule Sprockets\r\n  class Railtie < ::Rails::Railtie\r\n    config.assets.configure do |env|\r\n      env.cache = Sprockets::Cache::FileStore.new(\r\n        \"#{env.root}/tmp/cache\",\r\n        config.assets.cache_limit,\r\n        env.logger\r\n      )\r\n    end\r\n  end\r\nend\r\n```\r\n\r\nThis PR moves size calculation out of `initialze` method to avoid this issue."},"comment":{"url":"https://api.github.com/repos/rails/sprockets/issues/comments/224472984","html_url":"https://github.com/rails/sprockets/pull/211#issuecomment-224472984","issue_url":"https://api.github.com/repos/rails/sprockets/issues/211","id":224472984,"user":{"login":"jrafanie","id":19339,"avatar_url":"https://avatars.githubusercontent.com/u/19339?v=3","gravatar_id":"","url":"https://api.github.com/users/jrafanie","html_url":"https://github.com/jrafanie","followers_url":"https://api.github.com/users/jrafanie/followers","following_url":"https://api.github.com/users/jrafanie/following{/other_user}","gists_url":"https://api.github.com/users/jrafanie/gists{/gist_id}","starred_url":"https://api.github.com/users/jrafanie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrafanie/subscriptions","organizations_url":"https://api.github.com/users/jrafanie/orgs","repos_url":"https://api.github.com/users/jrafanie/repos","events_url":"https://api.github.com/users/jrafanie/events{/privacy}","received_events_url":"https://api.github.com/users/jrafanie/received_events","type":"User","site_admin":false},"created_at":"2016-06-08T02:44:43Z","updated_at":"2016-06-08T02:44:43Z","body":"@schneems Thanks.  I opened #307 to backport it to 3.x.  Let me know if you want a changelog or anything else."}}
{"actor":{"display_login":"jrafanie"}}