photoprism/internal/service/index.go
2020-12-04 19:51:51 +01:00

19 lines
331 B
Go

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