diff --git a/main.go b/main.go index 654becf..4e4a296 100644 --- a/main.go +++ b/main.go @@ -76,7 +76,7 @@ func setupEcho() *echo.Echo { e.GET("/venice/imagedata/:id", ui.AmServeVeniceCompatibleImage) } e.GET("/static/*", ui.AmStaticFileHandler()) - e.GET("/go/:postlink", ui.AmWrap(JumpToShortcut)) + e.GET("/go/:postlink", ui.AmWrap(JumpToShortcut), uiset...) e.GET("/", ui.AmWrap(TopPage), uiset...) e.GET("/about", ui.AmWrap(AboutPage), uiset...) diff --git a/ui/amsession.go b/ui/amsession.go index effb9fc..01d5d84 100644 --- a/ui/amsession.go +++ b/ui/amsession.go @@ -242,7 +242,7 @@ func (sess *amSession) Hit() { sess.Set("lasthit", time.Now()) } -// amSessionStore is the implementatiuon structure for AmSessionStore. +// amSessionStore is the implementation structure for AmSessionStore. type amSessionStore struct { mutex sync.RWMutex sessions map[string]*amSession @@ -342,6 +342,7 @@ func (st *amSessionStore) SessionInfo() (int, []string, int) { func (st *amSessionStore) sweep(tick <-chan time.Time, done chan bool) { for range tick { if st.sweepRunning.Load() { + log.Infof("session sweep running") // phase 1 - identify expired sessions st.mutex.RLock() zap := make([]string, 0, len(st.sessions)) @@ -352,6 +353,7 @@ func (st *amSessionStore) sweep(tick <-chan time.Time, done chan bool) { } } st.mutex.RUnlock() + log.Infof("identified %d sessions to zap", len(zap)) // phase 2 - get rid of the expired sessions for _, k := range zap {