Skip to content

Commit

Permalink
Merge pull request #266 from dvonthenen/adjust-default-timeout
Browse files Browse the repository at this point in the history
Fix DefaultTimeouts on REST and WS Operations
  • Loading branch information
davidvonthenen authored Apr 9, 2024
2 parents c42fca3 + 0093ca8 commit db50b7c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Deepgram/Abstractions/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ public static class Constants
// For Speak Headers
public const int OneSecond = 1000;
public const int OneMinute = 60 * OneSecond;
public const int DefaultRESTTimeout = 5 * OneMinute;
public const int DefaultRESTTimeout = 30 * OneSecond;
}

2 changes: 1 addition & 1 deletion Deepgram/Clients/Live/v1/Client.cs
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ public async Task Stop(CancellationTokenSource? cancelToken = null)
if (cancelToken == null)
{
Log.Information("Stop", "Using default disconnect cancellation token");
cancelToken = new CancellationTokenSource(Constants.DefaultConnectTimeout);
cancelToken = new CancellationTokenSource(Constants.DefaultDisconnectTimeout);
}

try
Expand Down
1 change: 1 addition & 0 deletions Deepgram/Clients/Live/v1/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ public static class Constants

// Default timeout for connect/disconnect
public const int DefaultConnectTimeout = 5000;
public const int DefaultDisconnectTimeout = 5000;
}

0 comments on commit db50b7c

Please sign in to comment.