mirror of
https://github.com/kataras/iris.git
synced 2025-03-15 04:06:25 +01: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:
parent
056f9a9415
commit
87d0f2e967
|
@ -45,6 +45,7 @@ Iris is a fast, simple and efficient micro web framework for Go. It provides a b
|
||||||
* [Middleware](middleware/)
|
* [Middleware](middleware/)
|
||||||
* [Dockerize](https://github.com/iris-contrib/cloud-native-go)
|
* [Dockerize](https://github.com/iris-contrib/cloud-native-go)
|
||||||
* [Community & Support](#-community)
|
* [Community & Support](#-community)
|
||||||
|
* [Blogs](http://iris-go.com/v8/blogs)
|
||||||
* [Versioning](#-version)
|
* [Versioning](#-version)
|
||||||
* [When should I upgrade?](#should-i-upgrade-my-iris)
|
* [When should I upgrade?](#should-i-upgrade-my-iris)
|
||||||
* [Where can I find older versions?](#where-can-i-find-older-versions)
|
* [Where can I find older versions?](#where-can-i-find-older-versions)
|
||||||
|
|
|
@ -2,7 +2,6 @@ package leveldb
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
|
||||||
"runtime"
|
"runtime"
|
||||||
|
|
||||||
"github.com/kataras/golog"
|
"github.com/kataras/golog"
|
||||||
|
@ -59,7 +58,7 @@ func New(directoryPath string) (*Database, error) {
|
||||||
return NewFromDB(service)
|
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) {
|
func NewFromDB(service *leveldb.DB) (*Database, error) {
|
||||||
if service == nil {
|
if service == nil {
|
||||||
return nil, errors.New("underline database is missing")
|
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 p.Action == sessions.ActionDestroy {
|
||||||
if err := db.destroy(bsid); err != nil {
|
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)
|
p.SessionID, err)
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
|
|
@ -11,8 +11,6 @@ const (
|
||||||
DefaultRedisAddr = "127.0.0.1:6379"
|
DefaultRedisAddr = "127.0.0.1:6379"
|
||||||
// DefaultRedisIdleTimeout the redis idle timeout option, time.Duration(5) * time.Minute
|
// DefaultRedisIdleTimeout the redis idle timeout option, time.Duration(5) * time.Minute
|
||||||
DefaultRedisIdleTimeout = 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
|
// Config the redis configuration used inside sessions
|
||||||
|
|
Loading…
Reference in New Issue
Block a user