Skip to content

Commit 133860d

Browse files
[backend] perf(stream): update exclusion with connector instance log (#4976)
1 parent 3d12847 commit 133860d

3 files changed

Lines changed: 9 additions & 3 deletions

File tree

openaev-api/src/main/java/io/openaev/rest/stream/StreamApi.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,15 @@ private void sendStreamEvent(FluxSink<Object> flux, BaseEvent event) {
6767
flux.next(message);
6868
}
6969

70-
private static final EnumSet<ResourceType> RESOURCES_STREAM_BLACKLIST =
71-
EnumSet.of(ResourceType.VULNERABILITY, ResourceType.PAYLOAD);
70+
private static final EnumSet<ResourceType> RESOURCES_STREAM_EXCLUSION =
71+
EnumSet.of(
72+
ResourceType.VULNERABILITY, ResourceType.PAYLOAD, ResourceType.CONNECTOR_INSTANCE_LOG);
7273

7374
@Async("streamExecutor")
7475
@Transactional
7576
@TransactionalEventListener
7677
public void listenDatabaseUpdate(BaseEvent event) {
77-
if (RESOURCES_STREAM_BLACKLIST.contains(event.getInstance().getResourceType())
78+
if (RESOURCES_STREAM_EXCLUSION.contains(event.getInstance().getResourceType())
7879
|| !event.isListened()) {
7980
return;
8081
}

openaev-model/src/main/java/io/openaev/database/model/ConnectorInstanceLog.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,8 @@ public class ConnectorInstanceLog implements Base {
4444
@JsonProperty("connector_instance_log_created_at")
4545
@Schema(description = "Connector instance log created at")
4646
private Instant connector_instance_log_created_at = Instant.now();
47+
48+
@Getter(onMethod_ = @JsonIgnore)
49+
@Transient
50+
private final ResourceType resourceType = ResourceType.CONNECTOR_INSTANCE_LOG;
4751
}

openaev-model/src/main/java/io/openaev/database/model/ResourceType.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ public enum ResourceType {
4242
OBJECTIVE,
4343
EVALUATION,
4444
CATALOG,
45+
CONNECTOR_INSTANCE_LOG,
4546
// Special resource types
4647
UNKNOWN,
4748
SIMULATION_OR_SCENARIO, // Used to represent either a simulation or a scenario.

0 commit comments

Comments
 (0)