We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents f324210 + d7498b3 commit f4691cfCopy full SHA for f4691cf
1 file changed
src/aws_credentials.erl
@@ -221,9 +221,15 @@ setup_update_callback(Expires) when is_binary(Expires) ->
221
setup_update_callback(Expires) when is_integer(Expires) ->
222
setup_callback(Expires - ?ALERT_BEFORE_EXPIRY).
223
224
--spec setup_callback(pos_integer()) -> reference().
+-spec setup_callback(integer()) -> reference().
225
setup_callback(Seconds) ->
226
- erlang:send_after(Seconds * 1000, self(), refresh_credentials).
+ erlang:send_after(timeout(Seconds) * 1000, self(), refresh_credentials).
227
+
228
+-spec timeout(integer()) -> pos_integer().
229
+timeout(Seconds) when is_integer(Seconds), Seconds >= 0 ->
230
+ Seconds;
231
+timeout(_) ->
232
+ ?RETRY_DELAY.
233
234
-spec seconds_until_timestamp(binary()) -> integer().
235
seconds_until_timestamp(Timestamp) ->
0 commit comments