minor fixes

This commit is contained in:
Jay
2026-05-22 17:05:31 -04:00
parent 35cfe0ebf6
commit a9ca8394c4
2 changed files with 4 additions and 8 deletions
-4
View File
@@ -56,10 +56,6 @@ func (s *EventSubgraph) FirstNodeByLabel(label string) *Node {
// Helpers // Helpers
func IsValidTag(t roots.Tag) bool { func IsValidTag(t roots.Tag) bool {
if len(t) < 2 {
// Skip tags that do not have name and value fields
return false
}
if len(t[0])+len(t[1]) > 8192 { if len(t[0])+len(t[1]) > 8192 {
// Skip tags that are too large for the neo4j indexer // Skip tags that are too large for the neo4j indexer
return false return false
+4 -4
View File
@@ -21,7 +21,7 @@ type preparedWrite struct {
Subgraph *EventSubgraph Subgraph *EventSubgraph
} }
type excludedEvent struct { type ExcludedEvent struct {
Event roots.ValidatedEvent Event roots.ValidatedEvent
Reason error Reason error
} }
@@ -32,7 +32,7 @@ type WriteResult struct {
} }
type WriteReport struct { type WriteReport struct {
ExcludedEvents []excludedEvent ExcludedEvents []ExcludedEvent
CreatedEventCount int CreatedEventCount int
Neo4jResultSummaries []neo4j.ResultSummary Neo4jResultSummaries []neo4j.ResultSummary
Duration time.Duration Duration time.Duration
@@ -81,7 +81,7 @@ func setDefaultWriteOptions(opts *WriteOptions) {
} }
} }
func enforcePolicyRules(in []roots.ValidatedEvent, boltdb *bolt.DB, batchSize int) (queued []roots.ValidatedEvent, excluded []excludedEvent) { func enforcePolicyRules(in []roots.ValidatedEvent, boltdb *bolt.DB, batchSize int) (queued []roots.ValidatedEvent, excluded []ExcludedEvent) {
for i := 0; i < len(in); i += batchSize { for i := 0; i < len(in); i += batchSize {
end := i + batchSize end := i + batchSize
if end > len(in) { if end > len(in) {
@@ -98,7 +98,7 @@ func enforcePolicyRules(in []roots.ValidatedEvent, boltdb *bolt.DB, batchSize in
for _, e := range batch { for _, e := range batch {
if existsMap[e.ID()] { if existsMap[e.ID()] {
excluded = append(excluded, excludedEvent{ excluded = append(excluded, ExcludedEvent{
Event: e, Event: e,
Reason: fmt.Errorf("skipped: %w", ErrDuplicate), Reason: fmt.Errorf("skipped: %w", ErrDuplicate),
}) })