Do not take time into account when checking EPP session limit

This commit is contained in:
Artur Beljajev 2019-09-17 17:55:24 +03:00 committed by Alex Sherman
parent 1e997ad5b1
commit 9eb7d3527b
2 changed files with 2 additions and 5 deletions

View file

@ -12,7 +12,7 @@ class EppSession < ApplicationRecord
alias_attribute :last_access, :updated_at
def self.limit_reached?(registrar)
count = where(user_id: registrar.api_users.ids).where('updated_at >= ?', Time.zone.now - 1.second).count
count = where(user_id: registrar.api_users.ids).count
count >= limit_per_registrar
end