瀏覽代碼

Don't check settings before calling StartIndexing()

The setting is checked by the StartIndexing function, so we can safely
call it and let it return immediately if it's not set.
Achilleas Koutsou 6 年之前
父節點
當前提交
a3abccfded
共有 2 個文件被更改,包括 2 次插入4 次删除
  1. 1 1
      cmd/serv.go
  2. 1 3
      models/repo_editor.go

+ 1 - 1
cmd/serv.go

@@ -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

+ 1 - 3
models/repo_editor.go

@@ -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)
 	return nil
 }