Skip to content

Commit f020630

Browse files
authored
fix: Fix handling of TTL in Go server (#3232)
Fix handling of TTL in Go server According to the FeatureView docstring, 'A ttl of 0 indicates that this group of features lives forever.' However, the Go feature server doesn't currently respect this, returning OUTSIDE_MAX_AGE for FeatureViews that have a TTL of 0. This fixes that issue by always returning false for checkOutsideTtl if the TTL is 0. Signed-off-by: William Horton <[email protected]> Signed-off-by: William Horton <[email protected]>
1 parent e117082 commit f020630

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

go/internal/feast/onlineserving/serving.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,9 @@ func getUniqueEntityRows(joinKeysProto []*prototypes.EntityKey) ([]*prototypes.E
633633
}
634634

635635
func checkOutsideTtl(featureTimestamp *timestamppb.Timestamp, currentTimestamp *timestamppb.Timestamp, ttl *durationpb.Duration) bool {
636+
if ttl.Seconds == 0 {
637+
return false
638+
}
636639
return currentTimestamp.GetSeconds()-featureTimestamp.GetSeconds() > ttl.Seconds
637640
}
638641

0 commit comments

Comments
 (0)