Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DYN-6350 add request timeout for notification service #14564

Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/DynamoCore/Configuration/Configurations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -429,5 +429,12 @@ internal static Dictionary<Units, double> SupportedUnits
}

#endregion

#region Notifications Constants
/// <summary>
/// Request timeOut for notifications service
/// </summary>
public const int NotificationsDefaultTimeOut = 10000;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ruby defaults to 60 seconds, and .NET defaults to 100s I think the current value is a good one for time saving purpose but not overly aggresive

#endregion
}
}
2 changes: 2 additions & 0 deletions src/Notifications/NotificationCenterController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
using Newtonsoft.Json;
using Microsoft.Web.WebView2.Wpf;
using Dynamo.Utilities;
using Dynamo.Configuration;

namespace Dynamo.Notifications
{
Expand Down Expand Up @@ -164,6 +165,7 @@ private void RequestNotifications()
var uri = DynamoUtilities.PathHelper.getServiceBackendAddress(this, "notificationAddress");
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);
request.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate;
request.Timeout = Configurations.NotificationsDefaultTimeOut;

using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
using (Stream stream = response.GetResponseStream())
Expand Down
Loading