浏览代码

[GinS] Indexing should be done on commit

cgars 7 年之前
父节点
当前提交
e4f9f75922
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      cmd/serv.go

+ 2 - 1
cmd/serv.go

@@ -293,7 +293,8 @@ func startIndexing(user, owner *models.User, repo *models.Repository) {
 		return
 	}
 	req, _ := http2.NewRequest(http2.MethodPost, setting.Search.IndexUrl, bytes.NewReader(data))
-	resp, err := http2.Client{}.Do(req)
+	client := http2.Client{}
+	resp, err := client.Do(req)
 	if err != nil || resp.StatusCode != http2.StatusOK {
 		log.Trace("Error doing index request:%+v,%d", err, resp.StatusCode)
 		return