-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make 3scale batching policy compatible with the caching policy #757
Changes from all commits
226bd0e
4453f1e
fa69e6a
9206762
4497c73
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ local concat = table.concat | |
local sort = table.sort | ||
local unpack = table.unpack | ||
local ngx_re = ngx.re | ||
local table = table | ||
local new_tab = require('resty.core.base').new_tab | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @mikz I remember that we discussed this in a previous PR. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
|
||
local _M = {} | ||
|
||
|
@@ -20,7 +20,7 @@ local function creds_part_in_key(creds) | |
end | ||
|
||
local function metrics_part_in_key(usage) | ||
local usages = table.new(#usage.metrics, 0) | ||
local usages = new_tab(#usage.metrics, 0) | ||
|
||
local deltas = usage.deltas | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this handler being called twice ? Once by APIcast policy and once by this one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, because when this policy is enabled, APIcast does not authorize nor report to the 3scale backend. And the handler is only called when there's a backend response to be handled.