Skip to content

Commit

Permalink
get_latest_version_real
Browse files Browse the repository at this point in the history
  • Loading branch information
chronolaw committed Nov 11, 2024
1 parent 9ae8004 commit f6580d5
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions kong/db/declarative/export.lua
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,23 @@ local function end_transaction(db)
end


local get_latest_version
do
local strategy

local function get_latest_version_real()
return strategy:get_latest_version()
end

get_latest_version = function()
-- ensure we get the initialized kong.db
strategy = require("kong.clustering.services.sync.strategies.postgres").new(kong.db)
get_latest_version = get_latest_version_real
return get_latest_version()
end
end


local function export_from_db_impl(emitter, skip_ws, skip_disabled_entities, expand_foreigns)
local schemas = {}

Expand All @@ -119,9 +136,7 @@ local function export_from_db_impl(emitter, skip_ws, skip_disabled_entities, exp

local sync_version
if emitter.want_sync_version then
local strategy = require("kong.clustering.services.sync.strategies.postgres").new(db)

sync_version = strategy:get_latest_version()
sync_version = get_latest_version()
end

emitter:emit_toplevel({
Expand Down

0 comments on commit f6580d5

Please sign in to comment.