mirror of
https://github.com/harness/drone.git
synced 2025-05-31 11:43:15 +00:00
feat: [CDE-483]: add lastupdated filter (#2992)
* add lastupdated filter
This commit is contained in:
parent
0ae23353c7
commit
f3713715c4
@ -336,6 +336,10 @@ func addGitspaceFilter(stmt squirrel.SelectBuilder, filter *types.GitspaceFilter
|
||||
stmt = stmt.Where(squirrel.Lt{"gits_last_used": filter.LastUsedBefore})
|
||||
}
|
||||
|
||||
if filter.LastUpdatedBefore > 0 {
|
||||
stmt = stmt.Where(squirrel.Lt{"gits_updated": filter.LastUpdatedBefore})
|
||||
}
|
||||
|
||||
if len(filter.GitspaceFilterStates) > 0 && len(filter.States) > 0 {
|
||||
log.Warn().Msgf("both view list filter and states are set for gitspace, the states[] are ignored")
|
||||
}
|
||||
|
@ -378,6 +378,10 @@ func addGitspaceInstanceFilter(
|
||||
stmt = stmt.Where(squirrel.Lt{"gits_last_used": filter.LastUsedBefore})
|
||||
}
|
||||
|
||||
if filter.LastUpdatedBefore > 0 {
|
||||
stmt = stmt.Where(squirrel.Lt{"gits_updated": filter.LastUpdatedBefore})
|
||||
}
|
||||
|
||||
if len(filter.States) > 0 {
|
||||
stmt = stmt.Where(squirrel.Eq{"gits_state": filter.States})
|
||||
}
|
||||
|
@ -96,6 +96,7 @@ type GitspaceInstanceFilter struct {
|
||||
UserIdentifier string
|
||||
LastUsedBefore int64
|
||||
LastHeartBeatBefore int64
|
||||
LastUpdatedBefore int64
|
||||
States []enum.GitspaceInstanceStateType
|
||||
SpaceIDs []int64
|
||||
Limit int
|
||||
|
Loading…
x
Reference in New Issue
Block a user