Merge remote-tracking branch 'origin/release-57' into sync-release-57-20240725-021830
This commit is contained in:
commit
f26a2357d8
|
@ -141,5 +141,5 @@ store_jwt(#{resource_id := ResourceId, table := TId}, JWT) ->
|
||||||
is_about_to_expire(JWT) ->
|
is_about_to_expire(JWT) ->
|
||||||
#jose_jwt{fields = #{<<"exp">> := Exp}} = jose_jwt:peek(JWT),
|
#jose_jwt{fields = #{<<"exp">> := Exp}} = jose_jwt:peek(JWT),
|
||||||
Now = erlang:system_time(seconds),
|
Now = erlang:system_time(seconds),
|
||||||
GraceExp = Exp - timer:seconds(5),
|
GraceExp = Exp - 5,
|
||||||
Now >= GraceExp.
|
Now >= GraceExp.
|
||||||
|
|
|
@ -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.
|
safe_atom(Atom) when is_atom(Atom) -> Atom.
|
||||||
|
|
||||||
parse_opts(Conf, Opts0) ->
|
parse_opts(Conf, Opts0) ->
|
||||||
Opts1 = override_start_after_created(Conf, Opts0),
|
Opts1 = emqx_resource:fetch_creation_opts(Conf),
|
||||||
set_no_buffer_workers(Opts1).
|
Opts2 = maps:merge(Opts1, Opts0),
|
||||||
|
Opts = override_start_after_created(Conf, Opts2),
|
||||||
|
set_no_buffer_workers(Opts).
|
||||||
|
|
||||||
override_start_after_created(Config, Opts) ->
|
override_start_after_created(Config, Opts) ->
|
||||||
Enabled = maps:get(enable, Config, true),
|
Enabled = maps:get(enable, Config, true),
|
||||||
|
|
|
@ -125,7 +125,7 @@ t_ensure_jwt(_Config) ->
|
||||||
JWT0 = emqx_connector_jwt:ensure_jwt(JWTConfig),
|
JWT0 = emqx_connector_jwt:ensure_jwt(JWTConfig),
|
||||||
?assertNot(is_expired(JWT0)),
|
?assertNot(is_expired(JWT0)),
|
||||||
%% should refresh 5 s before expiration
|
%% should refresh 5 s before expiration
|
||||||
ct:sleep(Expiration - 5500),
|
ct:sleep(Expiration - 3000),
|
||||||
JWT1 = emqx_connector_jwt:ensure_jwt(JWTConfig),
|
JWT1 = emqx_connector_jwt:ensure_jwt(JWTConfig),
|
||||||
?assertNot(is_expired(JWT1)),
|
?assertNot(is_expired(JWT1)),
|
||||||
%% fully expired
|
%% fully expired
|
||||||
|
|
|
@ -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.
|
Loading…
Reference in New Issue