Skip to content

Commit

Permalink
Merge pull request jellyfin#421 from cxfksword/master
Browse files Browse the repository at this point in the history
Add timeout setting for entire api request
  • Loading branch information
LordMike committed Jan 7, 2023
2 parents 4b10d74 + 07460ba commit b2bb3c6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
9 changes: 9 additions & 0 deletions TMDbLib/Client/TMDbClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,15 @@ public int MaxRetryCount
set => _client.MaxRetryCount = value;
}

/// <summary>
/// Gets or sets timeout when requests to TMDb API.
/// </summary>
public TimeSpan Timeout
{
get => _client.Timeout;
set => _client.Timeout = value;
}

/// <summary>
/// The session id that will be used when TMDb requires authentication
/// </summary>
Expand Down
6 changes: 6 additions & 0 deletions TMDbLib/Rest/RestClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ public int MaxRetryCount
}
}

public TimeSpan Timeout
{
get => HttpClient.Timeout;
set => HttpClient.Timeout = value;
}

public bool ThrowApiExceptions { get; set; }

internal ITMDbSerializer Serializer { get; }
Expand Down

0 comments on commit b2bb3c6

Please sign in to comment.