Created
August 30, 2018 17:10
-
-
Save imouaddine/424e8ecb0acf3c770042ec04e5073a5a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def fetch_events(start, end, timezone) | |
Rails.cache.fetch(cache_key, expires_in: 1.hour.from_now) do | |
GoogleClient.fetch_events | |
end | |
end | |
def cache_key | |
[ | |
start, | |
end, | |
timezone, | |
current_user.cache_key, | |
].join("-") | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment