summaryrefslogtreecommitdiffstats
path: root/modules/indexer/code
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2022-05-20 22:08:52 +0800
committerGitHub <noreply@github.com>2022-05-20 22:08:52 +0800
commitfd7d83ace60258acf7139c4c787aa8af75b7ba8c (patch)
tree50038348ec10485f72344f3ac80324e04abc1283 /modules/indexer/code
parentd81e31ad7826a81fc7139f329f250594610a274b (diff)
downloadgitea-fd7d83ace60258acf7139c4c787aa8af75b7ba8c.tar.gz
gitea-fd7d83ace60258acf7139c4c787aa8af75b7ba8c.zip
Move almost all functions' parameter db.Engine to context.Context (#19748)
* Move almost all functions' parameter db.Engine to context.Context * remove some unnecessary wrap functions
Diffstat (limited to 'modules/indexer/code')
-rw-r--r--modules/indexer/code/git.go2
-rw-r--r--modules/indexer/code/indexer.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/modules/indexer/code/git.go b/modules/indexer/code/git.go
index 60018af20c..66d76377ad 100644
--- a/modules/indexer/code/git.go
+++ b/modules/indexer/code/git.go
@@ -38,7 +38,7 @@ func getDefaultBranchSha(ctx context.Context, repo *repo_model.Repository) (stri
// getRepoChanges returns changes to repo since last indexer update
func getRepoChanges(ctx context.Context, repo *repo_model.Repository, revision string) (*repoChanges, error) {
- status, err := repo_model.GetIndexerStatus(repo, repo_model.RepoIndexerTypeCode)
+ status, err := repo_model.GetIndexerStatus(ctx, repo, repo_model.RepoIndexerTypeCode)
if err != nil {
return nil, err
}
diff --git a/modules/indexer/code/indexer.go b/modules/indexer/code/indexer.go
index f15b8d8651..9845ade3dd 100644
--- a/modules/indexer/code/indexer.go
+++ b/modules/indexer/code/indexer.go
@@ -108,7 +108,7 @@ func index(ctx context.Context, indexer Indexer, repoID int64) error {
return err
}
- return repo_model.UpdateIndexerStatus(repo, repo_model.RepoIndexerTypeCode, sha)
+ return repo_model.UpdateIndexerStatus(ctx, repo, repo_model.RepoIndexerTypeCode, sha)
}
// Init initialize the repo indexer