This is an automated email from the ASF dual-hosted git repository.
zehnder pushed a commit to branch 2577-pipeline-element-templates-do-not-work
in repository https://gitbox.apache.org/repos/asf/streampipes.git
The following commit(s) were added to
refs/heads/2577-pipeline-element-templates-do-not-work by this push:
new d7d9134933 fix(#2577): Add logic to remove pipeline templates in
ResetManagement
d7d9134933 is described below
commit d7d9134933b00a958fe23cc1a165bd77c4b3e47a
Author: Philipp Zehnder <[email protected]>
AuthorDate: Mon Mar 18 15:33:41 2024 +0100
fix(#2577): Add logic to remove pipeline templates in ResetManagement
---
.../java/org/apache/streampipes/rest/ResetManagement.java | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git
a/streampipes-rest/src/main/java/org/apache/streampipes/rest/ResetManagement.java
b/streampipes-rest/src/main/java/org/apache/streampipes/rest/ResetManagement.java
index 77fb60bb42..8319d0a4ee 100644
---
a/streampipes-rest/src/main/java/org/apache/streampipes/rest/ResetManagement.java
+++
b/streampipes-rest/src/main/java/org/apache/streampipes/rest/ResetManagement.java
@@ -85,6 +85,8 @@ public class ResetManagement {
removeAllAssets(username);
+ removeAllPipelineTemplates();
+
logger.info("Resetting the system was completed");
}
@@ -192,4 +194,16 @@ public class ResetManagement {
throw new SpRuntimeException("Could not delete assets of user
%s".formatted(username));
}
}
+
+ private static void removeAllPipelineTemplates() {
+ var pipelineElementTemplateStorage = StorageDispatcher
+ .INSTANCE
+ .getNoSqlStore()
+ .getPipelineElementTemplateStorage();
+
+ pipelineElementTemplateStorage
+ .getAll()
+ .forEach(pipelineElementTemplateStorage::deleteElement);
+
+ }
}