mirror of
				https://github.com/go-gitea/gitea
				synced 2025-10-31 03:18:24 +00:00 
			
		
		
		
	Fix CheckRepoStats and reuse it during migration (#18264)
The CheckRepoStats function missed the following counters: - label num_closed_issues & num_closed_pulls - milestone num_closed_issues & num_closed_pulls The update SQL statements for updating the repository num_closed_issues & num_closed_pulls fields were repeated in three functions (repo.CheckRepoStats, migrate.insertIssues and models.Issue.updateClosedNum) and were moved to a single helper. The UpdateRepoStats is implemented and called in the Finish migration method so that it happens immediately instead of wating for the CheckRepoStats to run. Signed-off-by: Loïc Dachary loic@dachary.org --- [source](https://lab.forgefriends.org/forgefriends/forgefriends/-/merge_requests/34)
This commit is contained in:
		
				
					committed by
					
						 GitHub
						GitHub
					
				
			
			
				
	
			
			
			
						parent
						
							7dde39a6db
						
					
				
				
					commit
					076cead40d
				
			| @@ -856,12 +856,12 @@ func updateCommentInfos(ctx context.Context, opts *CreateCommentOptions, comment | ||||
| 			} | ||||
| 		} | ||||
| 	case CommentTypeReopen, CommentTypeClose: | ||||
| 		if err = opts.Issue.updateClosedNum(e); err != nil { | ||||
| 		if err = opts.Issue.updateClosedNum(ctx); err != nil { | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
| 	// update the issue's updated_unix column | ||||
| 	return updateIssueCols(e, opts.Issue, "updated_unix") | ||||
| 	return updateIssueCols(ctx, opts.Issue, "updated_unix") | ||||
| } | ||||
|  | ||||
| func createDeadlineComment(ctx context.Context, doer *user_model.User, issue *Issue, newDeadlineUnix timeutil.TimeStamp) (*Comment, error) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user