Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

expires_in issue at Rails.cache.increment #346

Open
maxguzenski opened this Issue · 0 comments

1 participant

@maxguzenski

I've a strange issue, sometime it works, sometimes not, example:

    time_to_expire = (Time.now.end_of_day - Time.now).floor.seconds
    limit                = 50

    if Rails.cache.increment(:"user:#{current_user.id}:messages:count", 1, {:expires_in => time_to_expire}) > limit
      raise CanCan::AccessDenied.new("Without limit!", :limit_to, type)
    end

I have some users with 3 days cache without reset its increment key...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.