Skip to content

Commit

Permalink
Merge branch 'fix/#5686/weather_pbehaviors_develop' into 'develop'
Browse files Browse the repository at this point in the history
Issue[#5686](develop): fix pbh_origin_icon for pbh without tstop + fix delete /entity-pbehaviors endpoint for pbh without tstop

See merge request canopsis/canopsis-pro!4346
  • Loading branch information
mmourcia committed Nov 14, 2024
2 parents fc670fb + ebbdc74 commit 7b6c0c7
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 7b6c0c7

Please sign in to comment.