Fix "gob: name not registered for interface" error

This commits fixes the "gob: name not registered for interface" error when restarting Harbor by registering models.User

Signed-off-by: Wenkai Yin <yinw@vmware.com>
This commit is contained in:
Wenkai Yin 2018-08-16 22:31:47 +08:00
parent 95c0c259ec
commit db844d42f6

View File

@ -15,6 +15,7 @@
package main
import (
"encoding/gob"
"fmt"
"os"
"reflect"
@ -77,6 +78,7 @@ func main() {
//TODO
redisURL := os.Getenv("_REDIS_URL")
if len(redisURL) > 0 {
gob.Register(models.User{})
beego.BConfig.WebConfig.Session.SessionProvider = "redis"
beego.BConfig.WebConfig.Session.SessionProviderConfig = redisURL
}