Skip to content

Commit

Permalink
fix: cleanup [1316]
Browse files Browse the repository at this point in the history
```
$ make busted-util
/usr/local/openresty/luajit/bin/rover exec bin/busted "spec/threescale_utils_spec.lua"
●●●
3 successes / 0 failures / 0 errors / 0 pending : 0.023738 seconds
```
  • Loading branch information
abarrak committed Feb 10, 2022
1 parent ad69ecc commit 32b76f7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gateway/src/apicast/threescale_utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ function _M.error(resilient, ...)
else
ngx.status = ngx.HTTP_INTERNAL_SERVER_ERROR
ngx.say(...)
if not resilient or resilient == nil then
if not resilient then
ngx.exit(ngx.status)
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/threescale_utils_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('3scale utils', function()
stub(ngx, 'say', function(...) return nil end)
local exit = spy.on(ngx, 'exit', function(s) return 'exited!' end)

local error = _M.error(false, 'cache issue ' .. 'host:' .. 6379)
local error = _M.error(nil, 'cache issue ' .. 'host:' .. 6379)

assert.spy(ngx.exit).was_called(1)
assert.spy(ngx.say).was.called_with('cache issue ' .. 'host:' .. 6379)
Expand Down

0 comments on commit 32b76f7

Please sign in to comment.