Skip to content

Commit

Permalink
is_invalid_version
Browse files Browse the repository at this point in the history
  • Loading branch information
chronolaw committed Jan 6, 2025
1 parent 98d9c09 commit f189dac
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions kong/clustering/services/sync/rpc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ local function get_current_version()
end


local is_empty_version
local is_invalid_version
do
local byte = string.byte
local CHAR_V = byte("V")

-- version string must start with char 'V'
is_empty_version = function(v)
is_invalid_version = function(v)
return byte(v) ~= CHAR_V
end
end
Expand Down Expand Up @@ -117,7 +117,8 @@ function _M:init_cp(manager)
return nil, err
end

if is_empty_version(default_namespace_version) or
-- string comparison effectively does the same as number comparison
if is_invalid_version(default_namespace_version) or
default_namespace_version < latest_version then
return full_sync_result()
end
Expand Down

0 comments on commit f189dac

Please sign in to comment.