photoprism/internal/service/query.go
Michael Mayer 260cca91fe Backend: Refactor entity package
Signed-off-by: Michael Mayer <michael@liquidbytes.net>
2020-04-30 20:07:03 +02:00

19 lines
258 B
Go

package service
import (
"sync"
"github.com/photoprism/photoprism/internal/query"
)
var onceQuery sync.Once
func initQuery() {
services.Query = query.New(Config().Db())
}
func Query() *query.Query {
onceQuery.Do(initQuery)
return services.Query
}