search optimisation
Build and Push Docker Image / build (push) Failing after 13s

This commit is contained in:
Worph
2026-07-10 22:56:59 +02:00
parent 075d6f9bcb
commit d268bb83e6
4 changed files with 240 additions and 26 deletions
+9
View File
@@ -41,6 +41,7 @@ type Server struct {
metaPublisher *events.MetaPublisher
schemaIndexer *schema.Indexer
webdavHandler *webdav.Handler
search *searchIndex
router *mux.Router
server *http.Server
}
@@ -59,6 +60,7 @@ func NewServer(
discovery: disc,
cleaner: cleaner,
storage: stor,
search: &searchIndex{},
router: mux.NewRouter(),
}
@@ -314,6 +316,13 @@ func (s *Server) Start() error {
s.mountStatsPoller.Start()
}
// Build + periodically refresh the in-memory search index so
// POST /api/metadata/search matches in memory instead of a Redis
// round-trip per record (see search_index.go).
if s.storage != nil {
go s.search.runRefreshLoop(s.storage)
}
// Start meta publisher (if storage is connected)
// Publishes keyspace notifications to meta:events stream
if s.storage != nil && s.storage.IsConnected() {