#include "cynara_checker.hh"
#include "request_handler_factory.hh"
#include "server/database/db_handle_provider.hh"
+#include "server/database/remove_cache_db_handler.hh"
#include "utils/logging.hh"
#include "pkgmgrinfo_debug.h"
handler->PreExec();
handler->SetUID(ConvertUID(req->GetSenderUID()));
handler->SetPID(req->GetSenderPID());
- if (!handler->HandleRequest(req->GetData(), req->GetSize(),
+ if (!handler->HandleRequest(req->DetachData(), req->GetSize(),
locale_.GetObject()))
LOG(ERROR) << "Failed to handle request";
h->timer_ = 0;
}
- if (database::DBHandleProvider::IsCrashedWriteRequest())
- database::DBHandleProvider::GetInst(getuid()).UnsetMemoryMode(getpid());
+ auto crashed_writer_pids =
+ database::DBHandleProvider::CrashedWriteRequestPIDs();
+ if (!crashed_writer_pids.empty()) {
+ database::RemoveCacheDBHandler db(getuid(), std::move(crashed_writer_pids));
+ db.SetLocale(h->locale_.GetObject());
+ db.Execute();
+ }
sqlite3_release_memory(-1);
malloc_trim(0);
0, pkgmgr_common::parcel::ParcelableType::Unknown, PMINFO_R_ERROR);
tizen_base::Parcel p;
p.WriteParcelable(parcelable);
- req->SendData(std::move(p));
+ req->SendData(p);
}
} // namespace pkgmgr_server