diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2019-04-08 17:05:15 +0800 |
---|---|---|
committer | Lauris BH <lauris@nix.lv> | 2019-04-08 12:05:15 +0300 |
commit | e7d7dcb0901b32bed90061e7bc8ae1d2e3c75654 (patch) | |
tree | 1287587835fadda43f03f03ebb8b873091f356c8 /modules/setting | |
parent | 6e4af4985e60de2f7946be6b0fa5a5d24cdad78a (diff) | |
download | gitea-e7d7dcb0901b32bed90061e7bc8ae1d2e3c75654.tar.gz gitea-e7d7dcb0901b32bed90061e7bc8ae1d2e3c75654.zip |
Issue indexer queue redis support (#6218)
* add redis queue
* finished indexer redis queue
* add redis vendor
* fix vet
* Update docs/content/doc/advanced/config-cheat-sheet.en-us.md
Co-Authored-By: lunny <xiaolunwen@gmail.com>
* switch to go mod
* Update required changes for new logging func signatures
Diffstat (limited to 'modules/setting')
-rw-r--r-- | modules/setting/indexer.go | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/modules/setting/indexer.go b/modules/setting/indexer.go index 0e09ed2b86..36fd4a020b 100644 --- a/modules/setting/indexer.go +++ b/modules/setting/indexer.go @@ -13,26 +13,29 @@ import ( const ( LevelQueueType = "levelqueue" ChannelQueueType = "channel" + RedisQueueType = "redis" ) var ( // Indexer settings Indexer = struct { - IssueType string - IssuePath string - RepoIndexerEnabled bool - RepoPath string - UpdateQueueLength int - MaxIndexerFileSize int64 - IssueIndexerQueueType string - IssueIndexerQueueDir string - IssueIndexerQueueBatchNumber int + IssueType string + IssuePath string + RepoIndexerEnabled bool + RepoPath string + UpdateQueueLength int + MaxIndexerFileSize int64 + IssueQueueType string + IssueQueueDir string + IssueQueueConnStr string + IssueQueueBatchNumber int }{ - IssueType: "bleve", - IssuePath: "indexers/issues.bleve", - IssueIndexerQueueType: LevelQueueType, - IssueIndexerQueueDir: "indexers/issues.queue", - IssueIndexerQueueBatchNumber: 20, + IssueType: "bleve", + IssuePath: "indexers/issues.bleve", + IssueQueueType: LevelQueueType, + IssueQueueDir: "indexers/issues.queue", + IssueQueueConnStr: "", + IssueQueueBatchNumber: 20, } ) @@ -50,7 +53,8 @@ func newIndexerService() { } Indexer.UpdateQueueLength = sec.Key("UPDATE_BUFFER_LEN").MustInt(20) Indexer.MaxIndexerFileSize = sec.Key("MAX_FILE_SIZE").MustInt64(1024 * 1024) - Indexer.IssueIndexerQueueType = sec.Key("ISSUE_INDEXER_QUEUE_TYPE").MustString(LevelQueueType) - Indexer.IssueIndexerQueueDir = sec.Key("ISSUE_INDEXER_QUEUE_DIR").MustString(path.Join(AppDataPath, "indexers/issues.queue")) - Indexer.IssueIndexerQueueBatchNumber = sec.Key("ISSUE_INDEXER_QUEUE_BATCH_NUMBER").MustInt(20) + Indexer.IssueQueueType = sec.Key("ISSUE_INDEXER_QUEUE_TYPE").MustString(LevelQueueType) + Indexer.IssueQueueDir = sec.Key("ISSUE_INDEXER_QUEUE_DIR").MustString(path.Join(AppDataPath, "indexers/issues.queue")) + Indexer.IssueQueueConnStr = sec.Key("ISSUE_INDEXER_QUEUE_CONN_STR").MustString(path.Join(AppDataPath, "")) + Indexer.IssueQueueBatchNumber = sec.Key("ISSUE_INDEXER_QUEUE_BATCH_NUMBER").MustInt(20) } |