This commit is contained in:
yuanke 2016-11-03 10:41:51 +08:00
parent 8bf6ef4371
commit a075b6d237
2 changed files with 13 additions and 2 deletions

View File

@ -37,10 +37,13 @@ module AccountHelper
# Automatic activation
user.activate
user.last_login_on = Time.now
if user.save
tEndtime = Time.now
tUsedtime = (tEndtime.to_i-tStarttime.to_i)*1000+(tEndtime.usec - tStarttime.usec)/1000
Rails.logger.info "register_130 wait time = #{tUsedtime} ms"
if user.save
tEndtime = Time.now
tUsedtime = (tEndtime.to_i-tStarttime.to_i)*1000+(tEndtime.usec - tStarttime.usec)/1000
Rails.logger.info "register_131 wait time = #{tUsedtime} ms"
UserStatus.create(:user_id => user.id, :changsets_count => 0, :watchers_count => 0)
#self.logged_user = user
#flash[:notice] = l(:notice_account_activated)
@ -50,7 +53,7 @@ module AccountHelper
end
tEndtime = Time.now
tUsedtime = (tEndtime.to_i-tStarttime.to_i)*1000+(tEndtime.usec - tStarttime.usec)/1000
Rails.logger.info "register_131 wait time = #{tUsedtime} ms"
Rails.logger.info "register_132 wait time = #{tUsedtime} ms"
user
end

View File

@ -488,9 +488,13 @@ class User < Principal
def update_hashed_password
# update hashed_password if password was set
tStarttime = Time.now
if self.password && self.auth_source_id.blank?
salt_password(password)
end
tEndtime = Time.now
tUsedtime = (tEndtime.to_i-tStarttime.to_i)*1000+(tEndtime.usec - tStarttime.usec)/1000
Rails.logger.info "update_hashed_password wait time = #{tUsedtime} ms"
end
alias :base_reload :reload
@ -1287,9 +1291,13 @@ class User < Principal
end
end
def update_user_ealasticsearch_index
tStarttime = Time.now
if self.id != 2 && self.id != 4
self.__elasticsearch__.update_document if Rails.env.production?
end
tEndtime = Time.now
tUsedtime = (tEndtime.to_i-tStarttime.to_i)*1000+(tEndtime.usec - tStarttime.usec)/1000
Rails.logger.info "update_elastic wait time = #{tUsedtime} ms"
end
def delete_user_ealasticsearch_index
if self.id != 2 && self.id != 4