1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-08-05 09:55:20 +02:00

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

* 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 12:47:17 +01:00 committed by GitHub
parent 6cb127d497
commit 3d5d2fa9d8
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":