deadlineFor static method

Duration deadlineFor(
  1. int maxBytes
)

How long a fetch of up to maxBytes may take in all, retries and redirects included: two minutes, and as long again as maxBytes takes at minBytesPerSecond.

Implementation

static Duration deadlineFor(int maxBytes) =>
    Duration(seconds: 120 + maxBytes ~/ minBytesPerSecond);