photoprism/internal/service/index.go
Michael Mayer 1479a3ec5b Refactor indexer so that thumbs and jpegs can be created on demand #258
Signed-off-by: Michael Mayer <michael@liquidbytes.net>
2020-05-06 10:35:41 +02:00

19 lines
312 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())
}
func Index() *photoprism.Index {
onceIndex.Do(initIndex)
return services.Index
}