Skip to content

Commit c65a632

Browse files
fix: delete model for remote engine (#2105)
Co-authored-by: sangjanai <[email protected]>
1 parent 9e8f8a5 commit c65a632

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

engine/services/model_service.cc

+11-6
Original file line numberDiff line numberDiff line change
@@ -757,12 +757,17 @@ cpp::result<void, std::string> ModelService::DeleteModel(
757757
fs::path(model_entry.value().path_to_model_yaml));
758758
yaml_handler.ModelConfigFromFile(yaml_fp.string());
759759
auto mc = yaml_handler.GetModelConfig();
760-
// Remove yaml files
761-
for (const auto& entry :
762-
std::filesystem::directory_iterator(yaml_fp.parent_path())) {
763-
if (entry.is_regular_file() && (entry.path().extension() == ".yml")) {
764-
std::filesystem::remove(entry);
765-
CTL_INF("Removed: " << entry.path().string());
760+
if (engine_svc_->IsRemoteEngine(mc.engine)) {
761+
std::filesystem::remove(yaml_fp);
762+
CTL_INF("Removed: " << yaml_fp.string());
763+
} else {
764+
// Remove yaml files
765+
for (const auto& entry :
766+
std::filesystem::directory_iterator(yaml_fp.parent_path())) {
767+
if (entry.is_regular_file() && (entry.path().extension() == ".yml")) {
768+
std::filesystem::remove(entry);
769+
CTL_INF("Removed: " << entry.path().string());
770+
}
766771
}
767772
}
768773

0 commit comments

Comments
 (0)