mirror of
https://github.com/kataras/iris.git
synced 2025-12-18 02:17:05 +00:00
Add "Blogs" | Prev Commit: Update to 8.2.1 | LevelDB-based session database implemented, Read HISTORY.md
Former-commit-id: 1b7b288c1cf1d400f229794a33f3c049054f341f
This commit is contained in:
@@ -2,7 +2,6 @@ package leveldb
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
|
||||
"runtime"
|
||||
|
||||
"github.com/kataras/golog"
|
||||
@@ -59,7 +58,7 @@ func New(directoryPath string) (*Database, error) {
|
||||
return NewFromDB(service)
|
||||
}
|
||||
|
||||
// NewFromDB same as `New` but accepts an already-created custom boltdb connection instead.
|
||||
// NewFromDB same as `New` but accepts an already-created custom leveldb connection instead.
|
||||
func NewFromDB(service *leveldb.DB) (*Database, error) {
|
||||
if service == nil {
|
||||
return nil, errors.New("underline database is missing")
|
||||
@@ -153,7 +152,7 @@ func (db *Database) sync(p sessions.SyncPayload) {
|
||||
|
||||
if p.Action == sessions.ActionDestroy {
|
||||
if err := db.destroy(bsid); err != nil {
|
||||
golog.Errorf("error while destroying a session(%s) from boltdb: %v",
|
||||
golog.Errorf("error while destroying a session(%s) from leveldb: %v",
|
||||
p.SessionID, err)
|
||||
}
|
||||
return
|
||||
|
||||
@@ -11,8 +11,6 @@ const (
|
||||
DefaultRedisAddr = "127.0.0.1:6379"
|
||||
// DefaultRedisIdleTimeout the redis idle timeout option, time.Duration(5) * time.Minute
|
||||
DefaultRedisIdleTimeout = time.Duration(5) * time.Minute
|
||||
// DefaultRedisMaxAgeSeconds the redis storage last parameter (SETEX), 31556926.0 (1 year)
|
||||
DefaultRedisMaxAgeSeconds = 31556926.0 //1 year
|
||||
)
|
||||
|
||||
// Config the redis configuration used inside sessions
|
||||
|
||||
Reference in New Issue
Block a user