fixed user 登录更新时间改为5分钟更新一次
This commit is contained in:
parent
bdcd12fe74
commit
c014857cf5
|
@ -692,7 +692,11 @@ class User < Owner
|
||||||
# Returns the user who matches the given autologin +key+ or nil
|
# Returns the user who matches the given autologin +key+ or nil
|
||||||
def self.try_to_autologin(key)
|
def self.try_to_autologin(key)
|
||||||
user = Token.find_active_user('autologin', key)
|
user = Token.find_active_user('autologin', key)
|
||||||
user.update(last_login_on: Time.now) if user
|
if user
|
||||||
|
Rails.cache.fetch("user::update::last_login_on::#{user.id}",:expires_in => 5.minutes) do
|
||||||
|
user.update(last_login_on: Time.now)
|
||||||
|
end
|
||||||
|
end
|
||||||
user
|
user
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue