summaryrefslogtreecommitdiffstats
path: root/app/app.go
diff options
context:
space:
mode:
Diffstat (limited to 'app/app.go')
-rw-r--r--app/app.go14
1 files changed, 12 insertions, 2 deletions
diff --git a/app/app.go b/app/app.go
index c82520cd9..002a6a272 100644
--- a/app/app.go
+++ b/app/app.go
@@ -48,6 +48,8 @@ type App struct {
Saml einterfaces.SamlInterface
newStore func() store.Store
+
+ sessionCache *utils.Cache
}
var appCount = 0
@@ -64,10 +66,10 @@ func New(options ...Option) *App {
app := &App{
goroutineExitSignal: make(chan struct{}, 1),
- Jobs: &jobs.JobServer{},
Srv: &Server{
Router: mux.NewRouter(),
},
+ sessionCache: utils.NewLru(model.SESSION_CACHE_SIZE),
}
app.initEnterprise()
@@ -82,7 +84,7 @@ func New(options ...Option) *App {
}
app.Srv.Store = app.newStore()
- app.Jobs.Store = app.Srv.Store
+ app.initJobs()
app.Srv.Router.NotFoundHandler = http.HandlerFunc(app.Handle404)
@@ -218,6 +220,10 @@ func (a *App) initEnterprise() {
if dataRetentionInterface != nil {
a.DataRetention = dataRetentionInterface(a)
}
+}
+
+func (a *App) initJobs() {
+ a.Jobs = jobs.NewJobServer(a.Config, a.Srv.Store)
if jobsDataRetentionJobInterface != nil {
a.Jobs.DataRetentionJob = jobsDataRetentionJobInterface(a)
}
@@ -240,6 +246,10 @@ func (a *App) UpdateConfig(f func(*model.Config)) {
f(utils.Cfg)
}
+func (a *App) ConfigFileName() string {
+ return utils.CfgFileName
+}
+
// Go creates a goroutine, but maintains a record of it to ensure that execution completes before
// the app is destroyed.
func (a *App) Go(f func()) {