Depending on the severity of the infection of the anal glands it might take a while for your dog to completely heal. Your vet will probably want to clean them out again and keep him on antibiotics. I have heard of extreme situations where the anal glands need to be removed.