Skip to content

Commit

Permalink
fix(postgres) use pgmoon-mashape 2.0.0
Browse files Browse the repository at this point in the history
This fixes a namespace issue where lapis' pgmoon dependency would
override Mashape's pgmoon fork source code and lead to issues as
`pgmoon.socket` would not be used properly.
  • Loading branch information
thibaultcha committed Sep 1, 2016
1 parent 47557ef commit 89e61b3
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion bin/busted
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
-- force LuaSocket usage to resolve `/etc/hosts` until
-- supported by resty-cli.
-- See https://github.com/Mashape/kong/issues/1523
for _, namespace in ipairs({"cassandra", "pgmoon"}) do
for _, namespace in ipairs({"cassandra", "pgmoon-mashape"}) do
local socket = require(namespace .. ".socket")
socket.force_luasocket(ngx.get_phase(), true)
end
Expand Down
2 changes: 1 addition & 1 deletion bin/kong
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
-- force LuaSocket usage to resolve `/etc/hosts` until
-- supported by resty-cli.
-- See https://github.com/Mashape/kong/issues/1523
for _, namespace in ipairs({"cassandra", "pgmoon"}) do
for _, namespace in ipairs({"cassandra", "pgmoon-mashape"}) do
local socket = require(namespace .. ".socket")
socket.force_luasocket(ngx.get_phase(), true)
end
Expand Down
2 changes: 1 addition & 1 deletion kong-0.9.0-0.rockspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ dependencies = {
"version == 0.2",
"lapis == 1.5.1",
"lua-cassandra == 0.5.3",
"pgmoon-mashape == 1.7.0",
"pgmoon-mashape == 2.0.0",
"luatz == 0.3",
"lua_system_constants == 0.1.1",
"lua-resty-iputils == 0.2.1",
Expand Down
6 changes: 1 addition & 5 deletions kong/dao/postgres_db.lua
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
local pgmoon = require "pgmoon-mashape"
local BaseDB = require "kong.dao.base_db"
local Errors = require "kong.dao.errors"
local utils = require "kong.tools.utils"
local uuid = utils.uuid

local TTL_CLEANUP_INTERVAL = 60 -- 1 minute

local ngx_stub = _G.ngx
_G.ngx = nil
local pgmoon = require "pgmoon"
_G.ngx = ngx_stub

local PostgresDB = BaseDB:extend()

PostgresDB.dao_insert_values = {
Expand Down

0 comments on commit 89e61b3

Please sign in to comment.