{"action":"created","issue":{"url":"https://api.github.com/repos/spk/money-open-exchange-rates/issues/47","repository_url":"https://api.github.com/repos/spk/money-open-exchange-rates","labels_url":"https://api.github.com/repos/spk/money-open-exchange-rates/issues/47/labels{/name}","comments_url":"https://api.github.com/repos/spk/money-open-exchange-rates/issues/47/comments","events_url":"https://api.github.com/repos/spk/money-open-exchange-rates/issues/47/events","html_url":"https://github.com/spk/money-open-exchange-rates/issues/47","id":309173526,"number":47,"title":"(PROPOSAL) Method to update cache even if it's not empty","user":{"login":"tonidas","id":548878,"avatar_url":"https://avatars0.githubusercontent.com/u/548878?v=4","gravatar_id":"","url":"https://api.github.com/users/tonidas","html_url":"https://github.com/tonidas","followers_url":"https://api.github.com/users/tonidas/followers","following_url":"https://api.github.com/users/tonidas/following{/other_user}","gists_url":"https://api.github.com/users/tonidas/gists{/gist_id}","starred_url":"https://api.github.com/users/tonidas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tonidas/subscriptions","organizations_url":"https://api.github.com/users/tonidas/orgs","repos_url":"https://api.github.com/users/tonidas/repos","events_url":"https://api.github.com/users/tonidas/events{/privacy}","received_events_url":"https://api.github.com/users/tonidas/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-03-27T23:53:35Z","updated_at":"2018-03-28T18:09:32Z","closed_at":null,"author_association":"NONE","body":"Hello guys, first of all I would like to thank you for the work on this gem.\r\n\r\nI have a use case that might be different from the usual: I need to update the cache daily with the new json value from from the OER API, without clearing the cache at all.\r\nIn other words, I need to call the \"read_from_url\" method ad-hoc and ensure that the cache stays daily updated with data for my rails instances to consume it.\r\n\r\nFrom what I read in this gem, thats not possible, because the only way to trigger another request to the OER API to retrieve new data is to put a TTL on the cache data to trigger this logic when the cache is emptied:\r\n\r\n```ruby\r\ndef exchange_rates\r\n  doc = JSON.parse(read_from_cache || read_from_url)\r\n  @oer_rates = doc['rates']\r\nend\r\n```\r\n\r\nMy proposal is to somewhat leave a public method that resync the data with the API. (something like \"read_from_url\")\r\nDoes that makes sense?"},"comment":{"url":"https://api.github.com/repos/spk/money-open-exchange-rates/issues/comments/376982644","html_url":"https://github.com/spk/money-open-exchange-rates/issues/47#issuecomment-376982644","issue_url":"https://api.github.com/repos/spk/money-open-exchange-rates/issues/47","id":376982644,"user":{"login":"tonidas","id":548878,"avatar_url":"https://avatars0.githubusercontent.com/u/548878?v=4","gravatar_id":"","url":"https://api.github.com/users/tonidas","html_url":"https://github.com/tonidas","followers_url":"https://api.github.com/users/tonidas/followers","following_url":"https://api.github.com/users/tonidas/following{/other_user}","gists_url":"https://api.github.com/users/tonidas/gists{/gist_id}","starred_url":"https://api.github.com/users/tonidas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tonidas/subscriptions","organizations_url":"https://api.github.com/users/tonidas/orgs","repos_url":"https://api.github.com/users/tonidas/repos","events_url":"https://api.github.com/users/tonidas/events{/privacy}","received_events_url":"https://api.github.com/users/tonidas/received_events","type":"User","site_admin":false},"created_at":"2018-03-28T18:09:32Z","updated_at":"2018-03-28T18:09:32Z","author_association":"NONE","body":"Awesome @spk, thanks :)"}}
{"actor":{"display_login":"tonidas"}}