Unfortunately MemProvider Init does not actually Init properly (#6692) (#6693)

* Unfortunately MemProvider Init does not actually Init properly

Worse all of its members are private and you cannot update them.
Simple fix copy it in to modules session.

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Fix misspelling
This commit is contained in:
zeripath 2019-04-20 14:42:51 +01:00 committed by GitHub
parent d7aa553f1b
commit 497f37bffd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 218 additions and 1 deletions

View file

@ -5,6 +5,7 @@
package session
import (
"container/list"
"encoding/json"
"fmt"
"sync"
@ -38,7 +39,7 @@ func (o *VirtualSessionProvider) Init(gclifetime int64, config string) error {
// This is only slightly more wrong than modules/setting/session.go:23
switch opts.Provider {
case "memory":
o.provider = &session.MemProvider{}
o.provider = &MemProvider{list: list.New(), data: make(map[string]*list.Element)}
case "file":
o.provider = &session.FileProvider{}
case "redis":