Add logging & domain lock on release

This commit is contained in:
Alex Sherman 2021-01-05 14:58:01 +05:00
parent d35042a1be
commit 0c5ef72c7d
5 changed files with 30 additions and 3 deletions

View file

@ -2,6 +2,7 @@ module DNS
# Namespace is needed, because a class with the same name is defined by `domain_name` gem,
# a dependency of `actionmailer`,
class DomainName
include ToStdout
def initialize(name)
@name = name
end
@ -36,6 +37,7 @@ module DNS
auction = Auction.new
auction.domain = name
auction.start
to_stdout "Created the auction: #{auction.inspect}"
update_whois_from_auction(auction)
end
@ -100,7 +102,8 @@ module DNS
whois_record = Whois::Record.find_or_create_by!(name: name) do |record|
record.json = {}
end
to_stdout "Starting to update WHOIS record #{whois_record.inspect}\n\n"\
"from auction #{auction.inspect}"
whois_record.update_from_auction(auction)
end
end