Skip to content

Commit

Permalink
address pr comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Connor Ivy committed Jun 28, 2024
1 parent 2d42937 commit fe35219
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ public void Load(SpeckleContainerBuilder builder)
builder.AddSingleton<ISendConversionCache, SendConversionCache>();

// receive operation and dependencies
builder.AddScoped<ReceiveOperation>();
builder.AddScoped<IHostObjectBuilder, RevitHostObjectBuilder>();
builder.AddScoped<TransactionManager>();
builder.AddSingleton(DefaultTraversal.CreateTraversalFunc());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ private HostObjectBuilderResult BakeObjects(IEnumerable<TraversalContext> object
{
try
{
YieldToUiThread();
var result = _converter.Convert(tc.Current);
}
catch (Exception ex) when (!ex.IsFatal())
Expand All @@ -71,23 +70,4 @@ private HostObjectBuilderResult BakeObjects(IEnumerable<TraversalContext> object

return new(bakedObjectIds, conversionResults);
}

private DateTime _timerStarted = DateTime.MinValue;

private void YieldToUiThread()
{
var currentTime = DateTime.UtcNow;

if (currentTime.Subtract(_timerStarted) < TimeSpan.FromSeconds(.15))
{
return;
}

System.Windows.Threading.Dispatcher.CurrentDispatcher.Invoke(
() => { },
System.Windows.Threading.DispatcherPriority.Background
);

_timerStarted = currentTime;
}
}

0 comments on commit fe35219

Please sign in to comment.