Skip to content

Commit

Permalink
Add new session to filters for list
Browse files Browse the repository at this point in the history
Signed-off-by: Jason Parraga <[email protected]>
  • Loading branch information
Sovietaced committed Feb 27, 2025
1 parent 5f31aff commit 0112810
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions flyteadmin/pkg/repositories/gormimpl/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ func applyFilters(tx *gorm.DB, inlineFilters []common.InlineFilter, mapFilters [
tx = tx.Where(mapFilter.GetFilter())
}
if isolationFilter != nil {
tx = tx.Where(tx.Scopes(isolationFilter.GetScopes()...))
cleanSession := tx.Session(&gorm.Session{NewDB: true})
tx = tx.Where(cleanSession.Scopes(isolationFilter.GetScopes()...))
}
return tx, nil
}
Expand All @@ -114,7 +115,8 @@ func applyScopedFilters(tx *gorm.DB, inlineFilters []common.InlineFilter, mapFil
tx = tx.Where(mapFilter.GetFilter())
}
if isolationFilter != nil {
tx = tx.Where(tx.Scopes(isolationFilter.GetScopes()...))
cleanSession := tx.Session(&gorm.Session{NewDB: true})
tx = tx.Where(cleanSession.Scopes(isolationFilter.GetScopes()...))
}
return tx, nil
}
Expand Down

0 comments on commit 0112810

Please sign in to comment.