Browse Source

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 years ago
parent
commit
a3abccfded
2 changed files with 2 additions and 4 deletions
  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}
 		cmd = []string{verb, repoFullName}
 	}
 	}
 	runGit(cmd, requestMode, user, owner, repo)
 	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)
 		models.StartIndexing(user, owner, repo)
 	}
 	}
 	return nil
 	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)
 		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
 	return nil
 }
 }