summaryrefslogtreecommitdiffstats
path: root/modules/indexer
diff options
context:
space:
mode:
authorGusted <williamzijl7@hotmail.com>2022-01-20 18:00:38 +0100
committerGitHub <noreply@github.com>2022-01-20 18:00:38 +0100
commit1d98d205f5825f40110e6628b61a97c91ac7f72d (patch)
tree2326229027b9ba388732a912bff07ce4320aaf7c /modules/indexer
parent16d378fefc0a569f2a7aed29e6c7f288b3d83f02 (diff)
downloadgitea-1d98d205f5825f40110e6628b61a97c91ac7f72d.tar.gz
gitea-1d98d205f5825f40110e6628b61a97c91ac7f72d.zip
Enable deprecation error for v1.17.0 (#18341)
Co-authored-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'modules/indexer')
-rw-r--r--modules/indexer/issues/indexer.go2
-rw-r--r--modules/indexer/issues/indexer_test.go6
2 files changed, 4 insertions, 4 deletions
diff --git a/modules/indexer/issues/indexer.go b/modules/indexer/issues/indexer.go
index 4db5091762..8530210628 100644
--- a/modules/indexer/issues/indexer.go
+++ b/modules/indexer/issues/indexer.go
@@ -110,7 +110,7 @@ func InitIssueIndexer(syncReindex bool) {
return
}
- iData := make([]*IndexerData, 0, setting.Indexer.IssueQueueBatchNumber)
+ iData := make([]*IndexerData, 0, len(data))
for _, datum := range data {
indexerData, ok := datum.(*IndexerData)
if !ok {
diff --git a/modules/indexer/issues/indexer_test.go b/modules/indexer/issues/indexer_test.go
index 866e3cc7c9..ba35e37fd8 100644
--- a/modules/indexer/issues/indexer_test.go
+++ b/modules/indexer/issues/indexer_test.go
@@ -34,12 +34,12 @@ func TestBleveSearchIssues(t *testing.T) {
assert.Fail(t, "Unable to create temporary directory: %v", err)
return
}
- oldQueueDir := setting.Indexer.IssueQueueDir
+
+ setting.Cfg.Section("queue.issue_indexer").Key("DATADIR").MustString(path.Join(tmpIndexerDir, "issues.queue"))
+
oldIssuePath := setting.Indexer.IssuePath
- setting.Indexer.IssueQueueDir = path.Join(tmpIndexerDir, "issues.queue")
setting.Indexer.IssuePath = path.Join(tmpIndexerDir, "issues.queue")
defer func() {
- setting.Indexer.IssueQueueDir = oldQueueDir
setting.Indexer.IssuePath = oldIssuePath
util.RemoveAll(tmpIndexerDir)
}()