Commit graph

5 commits

Author SHA1 Message Date
Lunny Xiao
b167f35113
Add context parameter to some database functions ()
To avoid deadlock problem, almost database related functions should be
have ctx as the first parameter.
This PR do a refactor for some of these functions.
2023-07-22 22:14:27 +08:00
wxiaoguang
de2268ffab
Fix issue attachment handling ()
Close 

Some of the changes are taken from my another fix
f07b0de997
in  (although that PR was discarded ....)


The bug is:

1. The old code doesn't handle `removedfile` event correctly
2. The old code doesn't provide attachments for type=CommentTypeReview


This PR doesn't intend to refactor the "upload" code to a perfect state
(to avoid making the review difficult), so some legacy styles are kept.

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Giteabot <teabot@gitea.io>
2023-04-20 02:39:44 -04:00
wxiaoguang
cfe3d6e9b5
Make more functions use ctx instead of db.DefaultContext ()
Continue the "ctx refactoring" work.

There are still a lot db.DefaultContext, incorrect context could cause
database deadlock errors.
2023-04-14 14:18:28 -04:00
Jason Song
6135359a04
Always reuse transaction () 2023-01-08 09:34:58 +08:00
Lunny Xiao
68704532c2
Rename almost all Ctx functions () 2022-12-10 10:46:31 +08:00
Renamed from services/comments/comments.go (Browse further)