Annotations: Fix database lock while updating annotations (#71199)

This commit is contained in:
Emil Tullstedt
2023-07-07 15:21:49 +02:00
committed by GitHub
parent 217265baee
commit 56f52dc97e
2 changed files with 36 additions and 1 deletions
@@ -143,7 +143,13 @@ func (r *xormRepositoryImpl) synchronizeTags(ctx context.Context, item *annotati
}
func (r *xormRepositoryImpl) Update(ctx context.Context, item *annotations.Item) error {
return r.db.WithTransactionalDbSession(ctx, func(sess *db.Session) error {
return r.db.InTransaction(ctx, func(ctx context.Context) error {
return r.update(ctx, item)
})
}
func (r *xormRepositoryImpl) update(ctx context.Context, item *annotations.Item) error {
return r.db.WithDbSession(ctx, func(sess *db.Session) error {
var (
isExist bool
err error