Skip to content

Commit

Permalink
feat(init) checking that core shared dictionaries exist
Browse files Browse the repository at this point in the history
  • Loading branch information
subnetmarco committed Apr 28, 2017
1 parent 2fca928 commit f438e3f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@
[Amir M. Saeid](https://github.com/amir) for the contribution.
[#2430](https://github.com/Mashape/kong/pull/2430)
- Logging retries and failure information.
[#2429](https://github.com/Mashape/kong/pull/2429).
[#2429](https://github.com/Mashape/kong/pull/2429)
- Serf commands are now logged with a `DEBUG` log level.
[#2410](https://github.com/Mashape/kong/pull/2410)
- Checking that core Lua shared dictionaries are declared in the configuration.
[#2466](https://github.com/Mashape/kong/pull/2466)
- Plugins:
- :fireworks: **New Request termination plugin**. This plugin allows to
temporarily disable an API and return a pre-configured response status and
Expand Down
9 changes: 9 additions & 0 deletions kong/kong.lua
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,16 @@ end

local Kong = {}

local DICTS = { "kong", "cache", "cache_locks", "process_events", "cassandra"}

function Kong.init()
-- Check shared dictionaries
for _, dict in ipairs(DICTS) do
if not ngx.shared[dict] then
error("cannot find shared dictionary: "..dict)
end
end

local pl_path = require "pl.path"
local conf_loader = require "kong.conf_loader"

Expand Down

0 comments on commit f438e3f

Please sign in to comment.