@@ -12,10 +12,8 @@ import (
12
12
"github.com/avast/retry-go/v4"
13
13
"github.com/labstack/echo/v4"
14
14
"github.com/meilisearch/meilisearch-go"
15
- "github.com/prometheus/client_golang/prometheus"
16
15
"github.com/samber/lo"
17
16
"github.com/trim21/errgo"
18
- "github.com/trim21/pkg/queue"
19
17
"go.uber.org/zap"
20
18
21
19
"github.com/bangumi/server/config"
@@ -25,8 +23,6 @@ import (
25
23
type Searcher interface {
26
24
Handle (c echo.Context ) error
27
25
28
- Close ()
29
-
30
26
OnAdded (ctx context.Context , id uint32 ) error
31
27
OnUpdate (ctx context.Context , id uint32 ) error
32
28
OnDelete (ctx context.Context , id uint32 ) error
@@ -140,32 +136,6 @@ func NewDedupeFunc() func([]Document) []Document {
140
136
}
141
137
}
142
138
143
- func NewBatchQueue (cfg config.AppConfig , log * zap.Logger , index meilisearch.IndexManager ) * queue.Batched [Document ] {
144
- return queue .NewBatchedDedupe (
145
- NewSendBatch (log , index ),
146
- cfg .Search .SearchBatchSize ,
147
- cfg .Search .SearchBatchInterval ,
148
- NewDedupeFunc (),
149
- )
150
- }
151
-
152
- func RegisterQueueMetrics (idx string , queue * queue.Batched [Document ]) {
153
- prometheus .DefaultRegisterer .MustRegister (
154
- prometheus .NewGaugeFunc (
155
- prometheus.GaugeOpts {
156
- Namespace : "chii" ,
157
- Name : "meilisearch_queue_batch" ,
158
- Help : "meilisearch update queue batch size" ,
159
- ConstLabels : prometheus.Labels {
160
- "index" : idx ,
161
- },
162
- },
163
- func () float64 {
164
- return float64 (queue .Len ())
165
- },
166
- ))
167
- }
168
-
169
139
func GetAttributes (rt reflect.Type , tag string ) * []string {
170
140
var s []string
171
141
for i := 0 ; i < rt .NumField (); i ++ {
0 commit comments