Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: Testing some changes locally, pushing them up to save them
  • Loading branch information
devanbenz committed Aug 22, 2025
commit 8261e31a3b7d5ff4733fba9ba2bc6a9da611826c
14 changes: 6 additions & 8 deletions services/meta/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -1440,20 +1440,18 @@ func (a ShardGroupInfos) Less(i, j int) bool {

// Contains returns true iif StartTime ≤ t < EndTime (or TruncatedAt if truncated).
func (sgi *ShardGroupInfo) Contains(t time.Time) bool {
effectiveEnd := sgi.EndTime
if sgi.Truncated() {
effectiveEnd = sgi.TruncatedAt
if sgi.Truncated() && sgi.TruncatedAt.Equal(sgi.StartTime) {
return false
}
return !t.Before(sgi.StartTime) && t.Before(effectiveEnd)
return !t.Before(sgi.StartTime) && t.Before(sgi.EndTime)
}

// Overlaps returns whether the shard group contains data for the time range between min and max
func (sgi *ShardGroupInfo) Overlaps(min, max time.Time) bool {
effectiveEnd := sgi.EndTime
if sgi.Truncated() {
effectiveEnd = sgi.TruncatedAt
if sgi.Truncated() && sgi.TruncatedAt.Equal(sgi.StartTime) {
return false
}
return !sgi.StartTime.After(max) && effectiveEnd.After(min)
return !sgi.StartTime.After(max) && sgi.EndTime.After(min)
}

// Deleted returns whether this ShardGroup has been deleted.
Expand Down
Loading