Skip to content

Commit 23d261d

Browse files
committed
Remove Hot Reload Hooks (#8079)
1 parent 60d8bc1 commit 23d261d

File tree

1 file changed

+0
-44
lines changed

1 file changed

+0
-44
lines changed

src/HotChocolate/Core/src/Execution/RequestExecutorResolver.cs

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
using System.Collections.Concurrent;
22
using System.Collections.Frozen;
33
using System.Collections.Immutable;
4-
using System.Reflection.Metadata;
54
using System.Threading.Channels;
65
using HotChocolate.Configuration;
7-
using HotChocolate.Execution;
86
using HotChocolate.Execution.Caching;
97
using HotChocolate.Execution.Configuration;
108
using HotChocolate.Execution.Errors;
@@ -20,8 +18,6 @@
2018
using Microsoft.Extensions.ObjectPool;
2119
using static HotChocolate.Execution.ThrowHelper;
2220

23-
[assembly: MetadataUpdateHandler(typeof(RequestExecutorResolver.ApplicationUpdateHandler))]
24-
2521
namespace HotChocolate.Execution;
2622

2723
internal sealed partial class RequestExecutorResolver
@@ -61,10 +57,6 @@ public RequestExecutorResolver(
6157
ConsumeExecutorEvictionsAsync(executorEvictionChannel.Reader, _cts.Token).FireAndForget();
6258

6359
_optionsMonitor.OnChange(EvictRequestExecutor);
64-
65-
// we register the schema eviction for application updates when hot reload is used.
66-
// Whenever a hot reload update is triggered we will evict all executors.
67-
ApplicationUpdateHandler.RegisterForApplicationUpdate(EvictAllRequestExecutors);
6860
}
6961

7062
public IObservable<RequestExecutorEvent> Events => _events;
@@ -243,14 +235,6 @@ await CreateRequestExecutorAsync(schemaName, false, CancellationToken.None)
243235
}
244236
}
245237

246-
private void EvictAllRequestExecutors()
247-
{
248-
foreach (var key in _executors.Keys)
249-
{
250-
EvictRequestExecutor(key);
251-
}
252-
}
253-
254238
private static async Task RunEvictionEvents(RegisteredExecutor registeredExecutor)
255239
{
256240
try
@@ -777,32 +761,4 @@ private sealed class SchemaSetupInfo(
777761

778762
public IList<RequestCoreMiddleware> Pipeline { get; } = pipeline;
779763
}
780-
781-
/// <summary>
782-
/// A helper calls that receives hot reload update events from the runtime and triggers
783-
/// reload of registered components.
784-
/// </summary>
785-
internal static class ApplicationUpdateHandler
786-
{
787-
private static readonly List<Action> _actions = [];
788-
789-
public static void RegisterForApplicationUpdate(Action action)
790-
{
791-
lock (_actions)
792-
{
793-
_actions.Add(action);
794-
}
795-
}
796-
797-
public static void UpdateApplication(Type[]? updatedTypes)
798-
{
799-
lock (_actions)
800-
{
801-
foreach (var action in _actions)
802-
{
803-
action();
804-
}
805-
}
806-
}
807-
}
808764
}

0 commit comments

Comments
 (0)