MCPcopy
hub / github.com/mudler/LocalAI / SetGalleryStore

Method SetGalleryStore

core/services/galleryop/operation.go:230–234  ·  view source on GitHub ↗

SetGalleryStore enables PostgreSQL-backed OpCache persistence. Set/SetBackend upsert the cache_key + is_backend_op columns; Start hydrates the in-memory maps from active rows so a freshly-started replica does not return an empty /api/operations payload while a peer is mid-install.

(s *distributed.GalleryStore)

Source from the content-addressed store, hash-verified

228// replica does not return an empty /api/operations payload while a peer
229// is mid-install.
230func (m *OpCache) SetGalleryStore(s *distributed.GalleryStore) {
231 m.mu.Lock()
232 defer m.mu.Unlock()
233 m.store = s
234}
235
236// Start hydrates the in-memory maps from PostgreSQL (if a store was wired)
237// and subscribes to the broadcast subjects (if NATS was wired). It returns

Callers 5

APIFunction · 0.95
NewFunction · 0.45

Calls 2

LockMethod · 0.65
UnlockMethod · 0.65

Tested by

no test coverage detected