             (not (.isDone @download-supervisor))))))
 
 (defn- update-domains
-  "TODO: Always cleanup after update?"
   [download-supervisor domains-info edb-config rw-lock]
   (let [{max-kbs :max-online-download-rate-kb-s
          local-dir :local-dir} edb-config

                                (when-let [new-data (and (domain-has-data? local-vs)
                                                         (open-domain local-db-conf
                                                                      local-domain-root
                                                                      host-shards))]  
                                  (println "LOADING CACHED: " domain)
                                  (domain/set-domain-data! rw-lock domain info new-data)))
                              (domain/set-domain-status! info (thrift/ready-status))
                              (catch Throwable t
                                (log-error t "Error when loading domain " domain)
                                (domain/set-domain-status! info (thrift/failed-status t)))))]
    (with-ret loaders
      (log-message "Successfully loaded cached domains: " (s/join ", " (keys domains-info))))))

(defn purge-unused-domains!
  "Walks through the supplied local directory, recursively deleting

                                  domains-info
                                  :state download-state)
           (log-message "Finished updating all domains from remote.")
           (catch Throwable t
             (log-error t "Error when syncing data"))))))

