mirror of
				https://github.com/go-gitea/gitea
				synced 2025-11-04 05:18:25 +00:00 
			
		
		
		
	Rewrite delivery of issue and comment mails (#9009)
* Mail issue subscribers, rework the function * Simplify a little more * Fix unused variable * Refactor mail delivery to avoid heavy load on server * Avoid splitting into too many goroutines * Fix comments and optimize GetMaileableUsersByIDs() * Fix return on errors
This commit is contained in:
		@@ -41,6 +41,18 @@ func (issue *Issue) loadAssignees(e Engine) (err error) {
 | 
			
		||||
	return
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// GetAssigneeIDsByIssue returns the IDs of users assigned to an issue
 | 
			
		||||
// but skips joining with `user` for performance reasons.
 | 
			
		||||
// User permissions must be verified elsewhere if required.
 | 
			
		||||
func GetAssigneeIDsByIssue(issueID int64) ([]int64, error) {
 | 
			
		||||
	userIDs := make([]int64, 0, 5)
 | 
			
		||||
	return userIDs, x.Table("issue_assignees").
 | 
			
		||||
		Cols("assignee_id").
 | 
			
		||||
		Where("issue_id = ?", issueID).
 | 
			
		||||
		Distinct("assignee_id").
 | 
			
		||||
		Find(&userIDs)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// GetAssigneesByIssue returns everyone assigned to that issue
 | 
			
		||||
func GetAssigneesByIssue(issue *Issue) (assignees []*User, err error) {
 | 
			
		||||
	return getAssigneesByIssue(x, issue)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user