The setting is checked by the StartIndexing function, so we can safely call it and let it return immediately if it's not set.
@@ -273,7 +273,7 @@ func runServ(c *cli.Context) error {
cmd = []string{verb, repoFullName}
}
runGit(cmd, requestMode, user, owner, repo)
- if setting.Search.IndexURL != "" && (requestMode == models.ACCESS_MODE_WRITE) {
+ if requestMode == models.ACCESS_MODE_WRITE {
models.StartIndexing(user, owner, repo)
return nil
@@ -194,9 +194,7 @@ func (repo *Repository) UpdateRepoFile(doer *User, opts UpdateRepoFileOptions) (
return fmt.Errorf("git push origin %s: %v", opts.NewBranch, err)
- if setting.Search.IndexURL != "" {
- StartIndexing(doer, repo.MustOwner(), repo)
- }
+ StartIndexing(doer, repo.MustOwner(), repo)