photoprism/internal/service/index.go

20 lines
312 B
Go
Raw Normal View History

package service
import (
"sync"
"github.com/photoprism/photoprism/internal/photoprism"
)
var onceIndex sync.Once
func initIndex() {
services.Index = photoprism.NewIndex(Config(), Classify(), NsfwDetector(), Convert())
}
func Index() *photoprism.Index {
onceIndex.Do(initIndex)
return services.Index
}