Skip to content

Commit 4c5bddf

Browse files
Thomas StrombergThomas Stromberg
authored andcommitted
Improve freshness check
1 parent 7c0f638 commit 4c5bddf

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

main.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1022,16 +1022,25 @@ func generatePRDisplay(prs []PR, username string, blockingOnly, verbose, include
10221022
// Filter stale PRs unless includeStale is true
10231023
if !includeStale {
10241024
var filteredPRs []PR
1025+
staleDuration := 90 * 24 * time.Hour // 90 days
10251026
for i := range prs {
10261027
isStale := false
1027-
if prs[i].TurnResponse != nil {
1028+
1029+
// Check if PR is older than 90 days based on UpdatedAt
1030+
if time.Since(prs[i].UpdatedAt) > staleDuration {
1031+
isStale = true
1032+
}
1033+
1034+
// Also check TurnResponse tags if available
1035+
if !isStale && prs[i].TurnResponse != nil {
10281036
for _, tag := range prs[i].TurnResponse.PRState.Tags {
10291037
if tag == "stale" {
10301038
isStale = true
10311039
break
10321040
}
10331041
}
10341042
}
1043+
10351044
if !isStale {
10361045
filteredPRs = append(filteredPRs, prs[i])
10371046
}

0 commit comments

Comments
 (0)