Skip to content

Commit

Permalink
Merge pull request Kong#1589 from Mashape/fix/pg-log
Browse files Browse the repository at this point in the history
fix(postgres) properly logging TTL clean up errors
  • Loading branch information
thibaultcha authored Sep 2, 2016
2 parents faf43c0 + 52fcb33 commit ad07366
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion kong/dao/postgres_db.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ end

local function do_clean_ttl(premature, postgres)
if premature then return end
postgres:clear_expired_ttl()

local ok, err = postgres:clear_expired_ttl()
if not ok then
ngx.log(ngx.ERR, "failed to cleanup TTLs: ", err)
end
local ok, err = ngx.timer.at(TTL_CLEANUP_INTERVAL, do_clean_ttl, postgres)
if not ok then
ngx.log(ngx.ERR, "failed to create timer: ", err)
Expand Down

0 comments on commit ad07366

Please sign in to comment.