Found unused variable `expires` at lib/secure_session.rb, it seem like a mistake

found unused variable expires at lib/secure_session.rb, it seem like a mistake

https://github.com/discourse/discourse/blob/15f6f57cdcebc7583ddb5a311174d10a7300ae4a/lib/secure_session.rb#L18

def set(key, val, expires: nil)
    expires ||= SecureSession.expiry
    $redis.setex(prefixed_key(key), SecureSession.expiry.to_i, val.to_s)
    true
  end
5 Likes

@sam Should it be $redis.setex(prefixed_key(key), expires.to_i, val.to_s)? Looks like the specs don’t fail because they use the default value of 1 hour.

1 Like

Nice catch, yeah @gerhard that sounds right, fixed. Nice catch @coocooooo

https://github.com/discourse/discourse/commit/91daafc674a90221b355eb1930c1f47df2658cc9

2 Likes