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-6140: Fix ADP logging hang #15560

Merged
merged 1 commit into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
16 changes: 15 additions & 1 deletion src/DynamoCore/Configuration/PreferenceSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ public class PreferenceSettings : NotificationObject, IPreferences, IRenderPreci
private bool isBackgroundGridVisible;
private bool disableTrustWarnings = false;
private bool isNotificationCenterEnabled;
private bool isADPChecked = false;
private bool isADPOptedIn = false;

#region Constants
/// <summary>
/// Indicates the maximum number of files shown in Recent Files
Expand Down Expand Up @@ -77,12 +80,23 @@ public class PreferenceSettings : NotificationObject, IPreferences, IRenderPreci

/// <summary>
/// Indicates whether ADP analytics reporting is approved or not.
/// Note that this property is called often and the inner call to IsADPOptinIn can be slow sometimes
/// especially when there is an error involved. And therefore we will only check this once per instance.
/// </summary>
[XmlIgnore]
[Obsolete("Setter is obsolete - ADP consent should not be set directly, it should be set using the consent dialog.")]
public bool IsADPAnalyticsReportingApproved
{
get { return Logging.AnalyticsService.IsADPOptedIn; }
get
{
if (!isADPChecked)
{
isADPChecked = true;
isADPOptedIn = AnalyticsService.IsADPOptedIn;
}

return isADPOptedIn;
}
set { throw new Exception("do not use"); }
}
#endregion
Expand Down
6 changes: 3 additions & 3 deletions src/DynamoCore/Logging/AnalyticsService.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Dynamo.Graph.Workspaces;
using Dynamo.Graph.Workspaces;
using Dynamo.Models;
using Analytics.NET.ADP;
using Autodesk.Analytics.Core;
Expand Down Expand Up @@ -66,7 +66,7 @@ internal static bool IsADPOptedIn
{
return false;
}
return adpAnalyticsUI.IsOptedIn(150,200);
return adpAnalyticsUI.IsOptedIn(5,500);
}

set
Expand Down Expand Up @@ -121,4 +121,4 @@ internal static string GetUserIDForSession()
return null;
}
}
}
}
Loading