@@ -768,22 +768,19 @@ void destroy_db(std::string name, td::uint32 attempt, td::Promise<td::Unit> prom
768768 promise.set_value (td::Unit ());
769769 return ;
770770 }
771- if (S. is_error () && attempt > 0 && attempt % 64 == 0 ) {
771+ if (attempt > 0 && attempt % 64 == 0 ) {
772772 LOG (ERROR) << " failed to destroy index " << name << " : " << S;
773773 } else {
774774 LOG (DEBUG) << " failed to destroy index " << name << " : " << S;
775775 }
776776 delay_action (
777- [name, attempt, promise = std::move (promise)]() mutable { destroy_db (name, attempt, std::move (promise)); },
777+ [name, attempt, promise = std::move (promise)]() mutable { destroy_db (name, attempt + 1 , std::move (promise)); },
778778 td::Timestamp::in (1.0 ));
779779}
780780} // namespace
781781
782782void ArchiveSlice::destroy (td::Promise<td::Unit> promise) {
783783 before_query ();
784- td::MultiPromise mp;
785- auto ig = mp.init_guard ();
786- ig.add_promise (std::move (promise));
787784 destroyed_ = true ;
788785
789786 for (auto &p : packages_) {
@@ -795,10 +792,8 @@ void ArchiveSlice::destroy(td::Promise<td::Unit> promise) {
795792 packages_.clear ();
796793 kv_ = nullptr ;
797794
798- PackageId p_id{archive_id_, key_blocks_only_, temp_};
799- std::string db_path = PSTRING () << db_root_ << p_id.path () << p_id.name () << " .index" ;
800- delay_action ([name = db_path, attempt = 0 ,
801- promise = ig.get_promise ()]() mutable { destroy_db (name, attempt, std::move (promise)); },
795+ delay_action ([name = db_path_, attempt = 0 ,
796+ promise = std::move (promise)]() mutable { destroy_db (name, attempt, std::move (promise)); },
802797 td::Timestamp::in (0.0 ));
803798}
804799
0 commit comments