Skip to content

Commit

Permalink
style(daos): rename function parameter to keep consistency (#14242)
Browse files Browse the repository at this point in the history
  • Loading branch information
Oyami-Srk authored Feb 6, 2025
1 parent 70b4689 commit 55e4ff5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions kong/db/dao/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ local function check_upsert(self, key, entity, options, name)
end


local function recursion_over_constraints(self, entity, show_ws_id, entries, c)
local function recursion_over_constraints(self, entity, opts, entries, c)
local constraints = c and c.schema:get_constraints()
or self.schema:get_constraints()

Expand All @@ -650,15 +650,15 @@ local function recursion_over_constraints(self, entity, show_ws_id, entries, c)
if constraint.on_delete == "cascade" then
local dao = self.db.daos[constraint.schema.name]
local method = "each_for_" .. constraint.field_name
for row, err in dao[method](dao, pk, nil, show_ws_id) do
for row, err in dao[method](dao, pk, nil, opts) do
if not row then
log(ERR, "[db] failed to traverse entities for cascade-delete: ", err)
break
end

insert(entries, { dao = dao, entity = row })

recursion_over_constraints(self, row, show_ws_id, entries, constraint)
recursion_over_constraints(self, row, opts, entries, constraint)
end
end
end
Expand All @@ -667,10 +667,10 @@ local function recursion_over_constraints(self, entity, show_ws_id, entries, c)
end


local function find_cascade_delete_entities(self, entity, show_ws_id)
local function find_cascade_delete_entities(self, entity, opts)
local entries = {}

recursion_over_constraints(self, entity, show_ws_id, entries)
recursion_over_constraints(self, entity, opts, entries)

return entries
end
Expand Down

1 comment on commit 55e4ff5

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bazel Build

Docker image available kong/kong-dev:55e4ff53dd6264e451aa4fe8c98665d816329d5d
Artifacts available https://github.com/Kong/kong/actions/runs/13170470814

Please sign in to comment.