From 56706e66f2c15f11016b2b1e9fcfeb958c66854c Mon Sep 17 00:00:00 2001 From: Philippe Pittoli Date: Sun, 17 Mar 2024 22:45:19 +0100 Subject: [PATCH] Slighly change logs. --- src/storage.cr | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/storage.cr b/src/storage.cr index eaad922..8f401f9 100644 --- a/src/storage.cr +++ b/src/storage.cr @@ -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