Skip to content

Commit

Permalink
check latest_version and d.ws_id
Browse files Browse the repository at this point in the history
  • Loading branch information
chronolaw committed Oct 24, 2024
1 parent b4cd474 commit 3f52d75
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion kong/clustering/services/sync/rpc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ function _M:init_cp(manager)
end

local latest_version, err = self.strategy:get_latest_version()
if not latest_version then
if latest_version == nil or latest_version == ngx_null then
return nil, err
end

Expand Down
2 changes: 1 addition & 1 deletion kong/clustering/services/sync/strategies/postgres.lua
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function _M:insert_delta(deltas)
buf:putf("(new_version, %s, %s, %s, %s)",
self.connector:escape_literal(d.type),
self.connector:escape_literal(d.id),
self.connector:escape_literal(d.ws_id),
self.connector:escape_literal(d.ws_id or kong.default_workspace),
self.connector:escape_literal(cjson_encode(d.row)))
end

Expand Down

0 comments on commit 3f52d75

Please sign in to comment.