aboutsummaryrefslogtreecommitdiffstats
path: root/modules/setting/indexer.go
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/setting/indexer.go
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/setting/indexer.go')
-rw-r--r--modules/setting/indexer.go34
1 files changed, 11 insertions, 23 deletions
diff --git a/modules/setting/indexer.go b/modules/setting/indexer.go
index 2e9d8b2883..f103a7464b 100644
--- a/modules/setting/indexer.go
+++ b/modules/setting/indexer.go
@@ -14,32 +14,20 @@ import (
"github.com/gobwas/glob"
)
-// enumerates all the indexer queue types
-const (
- LevelQueueType = "levelqueue"
- ChannelQueueType = "channel"
- RedisQueueType = "redis"
-)
-
var (
// Indexer settings
Indexer = struct {
- IssueType string
- IssuePath string
- IssueConnStr string
- IssueIndexerName string
- IssueQueueType string // DEPRECATED - replaced by queue.issue_indexer
- IssueQueueDir string // DEPRECATED - replaced by queue.issue_indexer
- IssueQueueConnStr string // DEPRECATED - replaced by queue.issue_indexer
- IssueQueueBatchNumber int // DEPRECATED - replaced by queue.issue_indexer
- StartupTimeout time.Duration
+ IssueType string
+ IssuePath string
+ IssueConnStr string
+ IssueIndexerName string
+ StartupTimeout time.Duration
RepoIndexerEnabled bool
RepoType string
RepoPath string
RepoConnStr string
RepoIndexerName string
- UpdateQueueLength int // DEPRECATED - replaced by queue.issue_indexer
MaxIndexerFileSize int64
IncludePatterns []glob.Glob
ExcludePatterns []glob.Glob
@@ -49,7 +37,6 @@ var (
IssuePath: "indexers/issues.bleve",
IssueConnStr: "",
IssueIndexerName: "gitea_issues",
- IssueQueueType: LevelQueueType,
RepoIndexerEnabled: false,
RepoType: "bleve",
@@ -72,11 +59,12 @@ func newIndexerService() {
Indexer.IssueIndexerName = sec.Key("ISSUE_INDEXER_NAME").MustString(Indexer.IssueIndexerName)
// The following settings are deprecated and can be overridden by settings in [queue] or [queue.issue_indexer]
- Indexer.IssueQueueType = sec.Key("ISSUE_INDEXER_QUEUE_TYPE").MustString("")
- Indexer.IssueQueueDir = filepath.ToSlash(sec.Key("ISSUE_INDEXER_QUEUE_DIR").MustString(""))
- Indexer.IssueQueueConnStr = sec.Key("ISSUE_INDEXER_QUEUE_CONN_STR").MustString("")
- Indexer.IssueQueueBatchNumber = sec.Key("ISSUE_INDEXER_QUEUE_BATCH_NUMBER").MustInt(0)
- Indexer.UpdateQueueLength = sec.Key("UPDATE_BUFFER_LEN").MustInt(0)
+ // FIXME: DEPRECATED to be removed in v1.18.0
+ deprecatedSetting("indexer", "ISSUE_INDEXER_QUEUE_TYPE", "queue.issue_indexer", "TYPE")
+ deprecatedSetting("indexer", "ISSUE_INDEXER_QUEUE_DIR", "queue.issue_indexer", "DATADIR")
+ deprecatedSetting("indexer", "ISSUE_INDEXER_QUEUE_CONN_STR", "queue.issue_indexer", "CONN_STR")
+ deprecatedSetting("indexer", "ISSUE_INDEXER_QUEUE_BATCH_NUMBER", "queue.issue_indexer", "BATCH_LENGTH")
+ deprecatedSetting("indexer", "UPDATE_BUFFER_LEN", "queue.issue_indexer", "LENGTH")
Indexer.RepoIndexerEnabled = sec.Key("REPO_INDEXER_ENABLED").MustBool(false)
Indexer.RepoType = sec.Key("REPO_INDEXER_TYPE").MustString("bleve")