Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions engine/services/model_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -757,12 +757,17 @@ cpp::result<void, std::string> ModelService::DeleteModel(
fs::path(model_entry.value().path_to_model_yaml));
yaml_handler.ModelConfigFromFile(yaml_fp.string());
auto mc = yaml_handler.GetModelConfig();
// Remove yaml files
for (const auto& entry :
std::filesystem::directory_iterator(yaml_fp.parent_path())) {
if (entry.is_regular_file() && (entry.path().extension() == ".yml")) {
std::filesystem::remove(entry);
CTL_INF("Removed: " << entry.path().string());
if (engine_svc_->IsRemoteEngine(mc.engine)) {
std::filesystem::remove(yaml_fp);
CTL_INF("Removed: " << yaml_fp.string());
} else {
// Remove yaml files
for (const auto& entry :
std::filesystem::directory_iterator(yaml_fp.parent_path())) {
if (entry.is_regular_file() && (entry.path().extension() == ".yml")) {
std::filesystem::remove(entry);
CTL_INF("Removed: " << entry.path().string());
}
}
}

Expand Down
Loading