Skip to content

Commit

Permalink
Merge branch 'hotfix/resolve-hosts'
Browse files Browse the repository at this point in the history
  • Loading branch information
thibaultcha committed Aug 20, 2016
2 parents 42c30d4 + d062bf1 commit ef516c8
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
8 changes: 8 additions & 0 deletions bin/busted
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
#!/usr/bin/env resty

-- 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
local socket = require(namespace .. ".socket")
socket.force_luasocket(ngx.get_phase(), true)
end

package.path = "?/init.lua;"..package.path

if ngx ~= nil then
Expand Down
8 changes: 8 additions & 0 deletions bin/kong
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
#!/usr/bin/env resty

-- 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
local socket = require(namespace .. ".socket")
socket.force_luasocket(ngx.get_phase(), true)
end

require("kong.cmd.init")(arg)
4 changes: 2 additions & 2 deletions kong-0.9.0-0.rockspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ dependencies = {
"multipart == 0.3",
"version == 0.2",
"lapis == 1.5.1",
"lua-cassandra == 0.5.2",
"pgmoon == 1.6.0",
"lua-cassandra == 0.5.3",
"pgmoon-mashape == 1.7.0",
"luatz == 0.3",
"lua_system_constants == 0.1.1",
"lua-resty-iputils == 0.2.1",
Expand Down
8 changes: 6 additions & 2 deletions kong/dao/factory.lua
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ end

local function default_on_migrate(identifier, db_infos)
local log = require "kong.cmd.utils.log"
log("Migrating %s for %s %s",
log("migrating %s for %s %s",
identifier, db_infos.desc, db_infos.name)
end

Expand All @@ -235,6 +235,8 @@ function Factory:run_migrations(on_migrate, on_success)

local log = require "kong.cmd.utils.log"

log.verbose("running datastore migrations")

local migrations_modules = self:migrations_modules()
local cur_migrations, err = self:current_migrations()
if err then return nil, tostring(err) end
Expand All @@ -254,9 +256,11 @@ function Factory:run_migrations(on_migrate, on_success)
end

if migrations_ran > 0 then
log("Migrations up to date")
log("%d migrations ran", migrations_ran)
end

log.verbose("migrations up to date")

return true
end

Expand Down

0 comments on commit ef516c8

Please sign in to comment.