e3bb8b19dd
Also improves migrations and updates the db schema docs. Signed-off-by: Michael Mayer <michael@photoprism.app>
20 lines
291 B
Go
20 lines
291 B
Go
package get
|
|
|
|
import (
|
|
"sync"
|
|
"time"
|
|
|
|
gc "github.com/patrickmn/go-cache"
|
|
)
|
|
|
|
var onceThumbCache sync.Once
|
|
|
|
func initThumbCache() {
|
|
services.ThumbCache = gc.New(time.Hour*24, 10*time.Minute)
|
|
}
|
|
|
|
func ThumbCache() *gc.Cache {
|
|
onceThumbCache.Do(initThumbCache)
|
|
|
|
return services.ThumbCache
|
|
}
|