Przeglądaj źródła

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 lat temu
rodzic
commit
a3abccfded
2 zmienionych plików z 2 dodań i 4 usunięć
  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
 }