File tree 1 file changed +11
-6
lines changed
1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -757,12 +757,17 @@ cpp::result<void, std::string> ModelService::DeleteModel(
757
757
fs::path (model_entry.value ().path_to_model_yaml ));
758
758
yaml_handler.ModelConfigFromFile (yaml_fp.string ());
759
759
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
+ }
766
771
}
767
772
}
768
773
You can’t perform that action at this time.
0 commit comments