photoprism/internal/service/session.go
Michael Mayer 4bd0ca4ac6 Keep sessions for 7 days
Signed-off-by: Michael Mayer <michael@liquidbytes.net>
2020-04-20 13:50:28 +02:00

21 lines
350 B
Go

package service
import (
"sync"
"time"
"github.com/photoprism/photoprism/internal/session"
)
var onceSession sync.Once
func initSession() {
// keep sessions for 7 days by default
services.Session = session.New(168*time.Hour, Config().CachePath())
}
func Session() *session.Session {
onceSession.Do(initSession)
return services.Session
}