Skip to content

Commit

Permalink
Merge pull request #140 from mikefero/chore/release-3.9
Browse files Browse the repository at this point in the history
chore(*) release 3.9
  • Loading branch information
bungle authored Jan 14, 2022
2 parents 1d313f5 + 6e46318 commit 33393db
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
7 changes: 6 additions & 1 deletion Changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

All notable changes to `lua-resty-session` will be documented in this file.

## Unreleased
## [3.9] - 2022-01-14
### Fixed
- Fix #138 issue of chunked cookies are not expired when session shrinks,
thanks @alexdowad.
Expand All @@ -18,6 +18,11 @@ All notable changes to `lua-resty-session` will be documented in this file.
- Add `session_redis_password`
- Deprecate `session_redis_auth`; use `session_redis_password`

### Changed
- Optimize Redis and Memcache storage adapters to not connect to database
when not needed.


## [3.8] - 2021-01-04
### Added
- Connection options are now passed to `redis cluster client` as well.
Expand Down
2 changes: 1 addition & 1 deletion lib/resty/session.lua
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ local function init()
end

local session = {
_VERSION = "3.8"
_VERSION = "3.9"
}

session.__index = session
Expand Down
8 changes: 8 additions & 0 deletions lib/resty/session/storage/memcache.lua
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,10 @@ function storage:open(id, keep_lock)
end

function storage:start(id)
if not self.uselocking or not self.locked then
return true
end

local ok, err = self:connect()
if not ok then
return nil, err
Expand Down Expand Up @@ -244,6 +248,10 @@ function storage:save(id, ttl, data, close)
end

function storage:close(id)
if not self.uselocking or not self.locked then
return true
end

local ok, err = self:connect()
if not ok then
return nil, err
Expand Down
8 changes: 8 additions & 0 deletions lib/resty/session/storage/redis.lua
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,10 @@ function storage:open(id, keep_lock)
end

function storage:start(id)
if not self.uselocking or not self.locked then
return true
end

local ok, err = self:connect()
if not ok then
return nil, err
Expand Down Expand Up @@ -419,6 +423,10 @@ function storage:save(id, ttl, data, close)
end

function storage:close(id)
if not self.uselocking or not self.locked then
return true
end

local ok, err = self:connect()
if not ok then
return nil, err
Expand Down

0 comments on commit 33393db

Please sign in to comment.