Skip to content

Commit

Permalink
Make Timeout a TimeSpan Type
Browse files Browse the repository at this point in the history
  • Loading branch information
AmanAgnihotri committed Jul 20, 2021
1 parent 09f5b0d commit 402220c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Telegram.Bots/Configs/BotConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public sealed record BotConfig : IBotConfig

public string Token { get; init; } = null!;

public int Timeout { get; init; } = 90;
public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(90);

public int HandlerLifetime { get; init; } = 600;

Expand Down
2 changes: 1 addition & 1 deletion src/Telegram.Bots/ModuleExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static IHttpClientBuilder AddBotClient(this IServices services, BotConfig
return services.AddHttpClient<IBotClient, BotClient>(client =>
{
client.BaseAddress = config.BaseAddress;
client.Timeout = TimeSpan.FromSeconds(config.Timeout);
client.Timeout = config.Timeout;
})
.SetHandlerLifetime(TimeSpan.FromSeconds(config.HandlerLifetime))
.AddPolicyHandler(GetPolicy());
Expand Down

0 comments on commit 402220c

Please sign in to comment.