Refactoring, worked on middleware unit tests, and began thinking about api unit tests, #1921

This commit is contained in:
Torkel Ödegaard
2015-05-01 16:23:36 +02:00
parent d1e9b6d6ae
commit cb8110cd48
7 changed files with 99 additions and 47 deletions
+6 -3
View File
@@ -17,10 +17,13 @@ const (
var sessionManager *session.Manager
var sessionOptions *session.Options
var startSessionGC func()
func startSessionGC() {
sessionManager.GC()
time.AfterFunc(time.Duration(sessionOptions.Gclifetime)*time.Second, startSessionGC)
func init() {
startSessionGC = func() {
sessionManager.GC()
time.AfterFunc(time.Duration(sessionOptions.Gclifetime)*time.Second, startSessionGC)
}
}
func prepareOptions(opt *session.Options) *session.Options {