Slighly change logs.

master
Philippe Pittoli 2024-03-17 22:45:19 +01:00
parent f0eb1790bf
commit 56706e66f2
1 changed files with 5 additions and 6 deletions

View File

@ -260,26 +260,25 @@ class DNSManager::Storage
Response::DomainDeleted.new domain
end
# Get all removed users from `authd`, list all their domains and remove their data from `dnsmanagerd`.
def get_orphan_domains(authd : AuthD::Client, user_id : UserDataID) : IPC::JSON
user_must_be_admin! user_id
#Baguette::Log.warning "list all orphan domains (long computation)"
# Get all removed users from `authd`.
Baguette::Log.debug "list all orphan domains (long computation)"
orphans = [] of String
user_data.each do |user|
begin
authd.get_user? user.uid
rescue e
#Baguette::Log.warning "no authd info on user #{user.uid}: #{e}"
Baguette::Log.warning "no authd info on user #{user.uid}: #{e} (removing this user)"
Baguette::Log.debug "user #{user.uid} had #{user.domains.size} domains"
user.domains.each do |domain|
orphans << domain
end
#Baguette::Log.warning "Removing #{user.uid}!"
wipe_user_data user
end
end
#Baguette::Log.warning "total: #{orphans.size} orphans"
Baguette::Log.debug "total: #{orphans.size} orphans"
Response::OrphanDomainList.new orphans
end