diff options
author | 6543 <6543@obermui.de> | 2022-03-13 17:40:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-13 17:40:47 +0100 |
commit | bc0d2c8ada14eae81542f30a81552ed5cef8bd5d (patch) | |
tree | 5242a9e288f53cfc04e56df495a048d02a902d91 /models/action.go | |
parent | 780cf76f6e930b5e92fd12ae1e729c5702e70afa (diff) | |
download | gitea-bc0d2c8ada14eae81542f30a81552ed5cef8bd5d.tar.gz gitea-bc0d2c8ada14eae81542f30a81552ed5cef8bd5d.zip |
RSS/Atom support for Repos (#19055)
* support for repos
* refactor
* advertise the feeds via meta tags
* allow feed suffix and feed header
* optimize performance
Diffstat (limited to 'models/action.go')
-rw-r--r-- | models/action.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/models/action.go b/models/action.go index f2723a2014..e9f5138b40 100644 --- a/models/action.go +++ b/models/action.go @@ -328,7 +328,7 @@ type GetFeedsOptions struct { } // GetFeeds returns actions according to the provided options -func GetFeeds(opts GetFeedsOptions) ([]*Action, error) { +func GetFeeds(ctx context.Context, opts GetFeedsOptions) (ActionList, error) { if opts.RequestedUser == nil && opts.RequestedTeam == nil && opts.RequestedRepo == nil { return nil, fmt.Errorf("need at least one of these filters: RequestedUser, RequestedTeam, RequestedRepo") } @@ -338,7 +338,8 @@ func GetFeeds(opts GetFeedsOptions) ([]*Action, error) { return nil, err } - sess := db.GetEngine(db.DefaultContext).Where(cond) + e := db.GetEngine(ctx) + sess := e.Where(cond) opts.SetDefaultValues() sess = db.SetSessionPagination(sess, &opts) @@ -349,7 +350,7 @@ func GetFeeds(opts GetFeedsOptions) ([]*Action, error) { return nil, fmt.Errorf("Find: %v", err) } - if err := ActionList(actions).LoadAttributes(); err != nil { + if err := ActionList(actions).loadAttributes(e); err != nil { return nil, fmt.Errorf("LoadAttributes: %v", err) } |