feature: expired sessions can be deleted via a background goroutine.

- Call defer store.StopCleanup(store.Cleanup(time.Minute * 5)) after store creation.
- Does not break the existing API (optional, but recommended)
- Based on https://github.com/yosssi/boltstore/reaper
- Deletes expired sessions (where expireson > now())
- Includes tests
This commit is contained in:
Matt Silverlock
2015-07-11 11:11:09 +08:00
parent 794392bd2e
commit 1ad21d029c
4 changed files with 120 additions and 2 deletions

View File

@@ -1,11 +1,12 @@
package pgstore
import (
"github.com/gorilla/securecookie"
"github.com/gorilla/sessions"
"net/http"
"os"
"testing"
"github.com/gorilla/securecookie"
"github.com/gorilla/sessions"
)
type headerOnlyResponseWriter http.Header