@@ -53,21 +53,24 @@ var Indexer = struct {
53
53
func loadIndexerFrom (rootCfg ConfigProvider ) {
54
54
sec := rootCfg .Section ("indexer" )
55
55
Indexer .IssueType = sec .Key ("ISSUE_INDEXER_TYPE" ).MustString ("bleve" )
56
- Indexer .IssuePath = filepath .ToSlash (sec .Key ("ISSUE_INDEXER_PATH" ).MustString (filepath .ToSlash (filepath .Join (AppDataPath , "indexers/issues.bleve" ))))
57
- if ! filepath .IsAbs (Indexer .IssuePath ) {
58
- Indexer .IssuePath = filepath .ToSlash (filepath .Join (AppWorkPath , Indexer .IssuePath ))
59
- }
60
- Indexer .IssueConnStr = sec .Key ("ISSUE_INDEXER_CONN_STR" ).MustString (Indexer .IssueConnStr )
61
-
62
- if Indexer .IssueType == "meilisearch" {
63
- u , err := url .Parse (Indexer .IssueConnStr )
64
- if err != nil {
65
- log .Warn ("Failed to parse ISSUE_INDEXER_CONN_STR: %v" , err )
66
- u = & url.URL {}
56
+ if Indexer .IssueType == "bleve" {
57
+ Indexer .IssuePath = filepath .ToSlash (sec .Key ("ISSUE_INDEXER_PATH" ).MustString (filepath .ToSlash (filepath .Join (AppDataPath , "indexers/issues.bleve" ))))
58
+ if ! filepath .IsAbs (Indexer .IssuePath ) {
59
+ Indexer .IssuePath = filepath .ToSlash (filepath .Join (AppWorkPath , Indexer .IssuePath ))
60
+ }
61
+ fatalDuplicatedPath ("issue_indexer" , Indexer .IssuePath )
62
+ } else {
63
+ Indexer .IssueConnStr = sec .Key ("ISSUE_INDEXER_CONN_STR" ).MustString (Indexer .IssueConnStr )
64
+ if Indexer .IssueType == "meilisearch" {
65
+ u , err := url .Parse (Indexer .IssueConnStr )
66
+ if err != nil {
67
+ log .Warn ("Failed to parse ISSUE_INDEXER_CONN_STR: %v" , err )
68
+ u = & url.URL {}
69
+ }
70
+ Indexer .IssueConnAuth , _ = u .User .Password ()
71
+ u .User = nil
72
+ Indexer .IssueConnStr = u .String ()
67
73
}
68
- Indexer .IssueConnAuth , _ = u .User .Password ()
69
- u .User = nil
70
- Indexer .IssueConnStr = u .String ()
71
74
}
72
75
73
76
Indexer .IssueIndexerName = sec .Key ("ISSUE_INDEXER_NAME" ).MustString (Indexer .IssueIndexerName )
0 commit comments