NervesHubLink.Downloader.RetryConfig (nerves_hub_link v2.7.3)
View SourceDownload retry configuration.
This module provides configuration for how the Downloader
process will
handle disconnects, errors, and timeouts.
Options
:max_disconnects
(non_neg_integer/0
) - Maximum number of disconnects. After this limit is reached the download will be stopped and will no longer be retried. The default value is10
.:idle_timeout
(non_neg_integer/0
) - Time (in milliseconds) between chunks of data received that once elapsed will trigger a retry. This event counts towards themax_disconnects
counter. The default value is60000
.:max_timeout
(non_neg_integer/0
) - Maximum time (in milliseconds) that a download can exist for. After this amount of time has elapsed, the download is canceled and the download process will crash. The default value is 24 hours. The default value is86400000
.:time_between_retries
(non_neg_integer/0
) - Time (in milliseconds) to wait before attempting to retry a download. The default value is15000
.:worst_case_download_speed
(non_neg_integer/0
) - Worst case download speed specified in bytes per second. This is used to calculate the "worst case" ("sensible") download timeout and is intended to fail faster than waiting formax_timeout
to elapse. For reference, LTE Cat M1 modems sometimes top out at 32 kbps (30 kbps for some slack). The default value is30000
.
Summary
Functions
Validates a proposed configuration, returning the default configuration on error
Types
@type t() :: %NervesHubLink.Downloader.RetryConfig{ idle_timeout: non_neg_integer(), max_disconnects: non_neg_integer(), max_timeout: non_neg_integer(), time_between_retries: non_neg_integer(), worst_case_download_speed: non_neg_integer() }