Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added cache clear #13

Merged
merged 2 commits into from Aug 5, 2014
Merged

Added cache clear #13

merged 2 commits into from Aug 5, 2014

Conversation

gnagel
Copy link
Contributor

@gnagel gnagel commented Aug 5, 2014

No description provided.

Glenn Nagel and others added 2 commits August 5, 2014 12:32
Stephenitis added a commit that referenced this pull request Aug 5, 2014
@Stephenitis Stephenitis merged commit ddbb361 into iron-io:master Aug 5, 2014
@featalion
Copy link
Contributor

@gnagel thanks for the PR, @Stephenitis, but it is better to use:

instead

@client.post( "projects/#{ @client.project_id }/caches/#{ opts[:namespace] }/clear" )

it is better to do something like that:

with_namespace('', options) do |cache, _|
  cache.clear
end

@Stephenitis
Copy link
Contributor

I didn't see that existed.
ref:

def with_namespace(key, options)
options[:namespace] ||= 'rails_cache'
cache_name = options[:namespace]
yield(@client.cache(cache_name), escape_key(key))
end

@featalion
Copy link
Contributor

do not worry, I haven't tested my solution yet. Anyway, current one works too. But if we will change the IronCache API this method could be broken.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants