forked from forgejo/forgejo
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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue