mirror of
https://github.com/internetee/registry.git
synced 2025-08-06 01:35:10 +02:00
Remove hardcoded value
This commit is contained in:
parent
daeb00ebe7
commit
59fbcde4ca
3 changed files with 5 additions and 8 deletions
|
@ -6,11 +6,10 @@ class EppSession < ApplicationRecord
|
|||
class_attribute :timeout
|
||||
self.timeout = (ENV['epp_session_timeout_seconds'] || 300).to_i.seconds
|
||||
|
||||
alias_attribute :last_access, :updated_at
|
||||
class_attribute :limit_per_registrar
|
||||
self.limit_per_registrar = (ENV['epp_session_limit_per_registrar'] || 4).to_i
|
||||
|
||||
def self.limit_per_registrar
|
||||
4
|
||||
end
|
||||
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue