Merge "maintenance: recompile if there's no prefetch_file db row" into rvc-dev am: d441ab0307 am: 90d3f64da1
Change-Id: I2d1c614e9c1931cc585d6373e6a82fc06c5c2cb3
diff --git a/src/maintenance/controller.cc b/src/maintenance/controller.cc
index eb3fb6f..cea7a55 100644
--- a/src/maintenance/controller.cc
+++ b/src/maintenance/controller.cc
@@ -269,9 +269,20 @@
std::string file_path = output_file.FilePath();
- if (!params.recompile && std::filesystem::exists(file_path)) {
- LOG(DEBUG) << "compiled trace exists in " << file_path;
- return true;
+ if (!params.recompile) {
+ if (std::filesystem::exists(file_path)) {
+ LOG(DEBUG) << "compiled trace exists in " << file_path;
+
+ db::VersionedComponentName vcn{package_name, activity_name, version};
+ std::optional<db::PrefetchFileModel> prefetch_file =
+ db::PrefetchFileModel::SelectByVersionedComponentName(db, vcn);
+ if (prefetch_file) {
+ return true;
+ } else {
+ LOG(WARNING) << "Missing corresponding prefetch_file db row for " << vcn;
+ // let it go and compile again. we'll insert the prefetch_file at the bottom.
+ }
+ }
}
std::optional<db::ActivityModel> activity =