more context for models (#19511)
make more usage of context, to have more db transaction in one session (make diff of #9307 smaller)
This commit is contained in:
parent
332b2ecd21
commit
06e4687cec
54 changed files with 275 additions and 245 deletions
|
@ -88,7 +88,7 @@ func GetListLockHandler(ctx *context.Context) {
|
|||
})
|
||||
return
|
||||
}
|
||||
lock, err := models.GetLFSLockByID(v)
|
||||
lock, err := models.GetLFSLockByID(ctx, v)
|
||||
if err != nil && !models.IsErrLFSLockNotExist(err) {
|
||||
log.Error("Unable to get lock with ID[%s]: Error: %v", v, err)
|
||||
}
|
||||
|
@ -98,7 +98,7 @@ func GetListLockHandler(ctx *context.Context) {
|
|||
|
||||
path := ctx.FormString("path")
|
||||
if path != "" { // Case where we request a specific id
|
||||
lock, err := models.GetLFSLock(repository, path)
|
||||
lock, err := models.GetLFSLock(ctx, repository, path)
|
||||
if err != nil && !models.IsErrLFSLockNotExist(err) {
|
||||
log.Error("Unable to get lock for repository %-v with path %s: Error: %v", repository, path, err)
|
||||
}
|
||||
|
|
|
@ -488,7 +488,7 @@ func authenticate(ctx *context.Context, repository *repo_model.Repository, autho
|
|||
}
|
||||
|
||||
// ctx.IsSigned is unnecessary here, this will be checked in perm.CanAccess
|
||||
perm, err := models.GetUserRepoPermission(repository, ctx.Doer)
|
||||
perm, err := models.GetUserRepoPermission(ctx, repository, ctx.Doer)
|
||||
if err != nil {
|
||||
log.Error("Unable to GetUserRepoPermission for user %-v in repo %-v Error: %v", ctx.Doer, repository)
|
||||
return false
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue