4bd0ca4ac6
Signed-off-by: Michael Mayer <michael@liquidbytes.net>
21 lines
350 B
Go
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
|
|
}
|