RRAdded response message.

This commit is contained in:
Philippe Pittoli 2023-07-11 02:15:37 +02:00
parent 3fcb3a0d64
commit 52e7aea4fa
2 changed files with 11 additions and 1 deletions

View File

@ -70,5 +70,13 @@ class DNSManager::Response
end
end
DNSManager.responses << RRDeleted
IPC::JSON.message RRAdded, 19 do
property domain : String
property rr : Storage::Zone::ResourceRecord
def initialize(@domain, @rr)
end
end
DNSManager.responses << RRAdded
end

View File

@ -168,12 +168,14 @@ class DNSManager::Storage
end
end
puts "RRID before: #{rr.rrid}"
zone << rr
puts "RRID after: #{rr.rrid}"
# Update the zone.
zones_by_domain.update_or_create zone.domain, zone
Response::Success.new
Response::RRAdded.new zone.domain, rr
rescue e
Baguette::Log.error "trying to add a resource record in domain #{domain}: #{e}"
Response::Error.new "error while adding a resource record in domain #{domain}"