Merge remote-tracking branch 'origin/release-57' into sync-release-57-20240725-021830

This commit is contained in:
id 2024-07-25 02:18:30 +00:00
commit f26a2357d8
4 changed files with 7 additions and 4 deletions

View File

@ -141,5 +141,5 @@ store_jwt(#{resource_id := ResourceId, table := TId}, JWT) ->
is_about_to_expire(JWT) ->
#jose_jwt{fields = #{<<"exp">> := Exp}} = jose_jwt:peek(JWT),
Now = erlang:system_time(seconds),
GraceExp = Exp - timer:seconds(5),
GraceExp = Exp - 5,
Now >= GraceExp.

View File

@ -352,8 +352,10 @@ safe_atom(Bin) when is_binary(Bin) -> binary_to_existing_atom(Bin, utf8);
safe_atom(Atom) when is_atom(Atom) -> Atom.
parse_opts(Conf, Opts0) ->
Opts1 = override_start_after_created(Conf, Opts0),
set_no_buffer_workers(Opts1).
Opts1 = emqx_resource:fetch_creation_opts(Conf),
Opts2 = maps:merge(Opts1, Opts0),
Opts = override_start_after_created(Conf, Opts2),
set_no_buffer_workers(Opts).
override_start_after_created(Config, Opts) ->
Enabled = maps:get(enable, Config, true),

View File

@ -125,7 +125,7 @@ t_ensure_jwt(_Config) ->
JWT0 = emqx_connector_jwt:ensure_jwt(JWTConfig),
?assertNot(is_expired(JWT0)),
%% should refresh 5 s before expiration
ct:sleep(Expiration - 5500),
ct:sleep(Expiration - 3000),
JWT1 = emqx_connector_jwt:ensure_jwt(JWTConfig),
?assertNot(is_expired(JWT1)),
%% fully expired

View File

@ -0,0 +1 @@
Fixed an issue where a connector wouldn't respect the configured health check interval when first starting up, and would need an update/restart for the correct value to take effect.