Skip to content

Commit

Permalink
fix(#5686): fix pbh_origin_icon for pbh without tstop + fix delete /e…
Browse files Browse the repository at this point in the history
…ntity-pbehaviors endpoint for pbh without tstop
  • Loading branch information
Oldook committed Nov 11, 2024
1 parent fc670fb commit ebbdc74
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion community/go-engines-community/lib/api/pbehavior/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,10 @@ func (s *store) EntityDelete(ctx context.Context, r BulkEntityDeleteRequestItem)
"entity": r.Entity,
"origin": r.Origin,
"tstart": bson.M{"$lte": now},
"tstop": bson.M{"$gte": now},
"$or": bson.A{
bson.M{"tstop": nil},
bson.M{"tstop": bson.M{"$gte": now}},
},
}, options.FindOneAndDelete().SetProjection(bson.M{"_id": 1})).
Decode(&pbh)
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,10 @@ func getPbhOriginLookup(origin string, now datetime.CpsTime) []bson.M {
{"$match": bson.M{
"origin": origin,
"tstart": bson.M{"$lte": now},
"tstop": bson.M{"$gte": now},
"$or": bson.A{
bson.M{"tstop": nil},
bson.M{"tstop": bson.M{"$gte": now}},
},
}},
{"$limit": 1},
},
Expand Down

0 comments on commit ebbdc74

Please sign in to comment.