mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-03 03:40:49 +08:00
fixed user 登录更新时间改为5分钟更新一次
This commit is contained in:
@@ -692,7 +692,11 @@ class User < Owner
|
||||
# Returns the user who matches the given autologin +key+ or nil
|
||||
def self.try_to_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
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user