Skip to content

Commit 19e4121

Browse files
mhoegerfabiocav
authored andcommitted
getting rid of warnings
1 parent 60eba99 commit 19e4121

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/DotNetWorker.Core/Converters/JsonPocoConverter.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ public JsonPocoConverter(IOptions<WorkerOptions> options)
2020
{
2121
throw new ArgumentNullException(nameof(options));
2222
}
23+
if (options.Value.Serializer == null)
24+
{
25+
throw new InvalidOperationException(nameof(options.Value.Serializer));
26+
}
2327

2428
_serializer = options.Value.Serializer;
2529
}

src/DotNetWorker.Grpc/GrpcWorker.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ internal class GrpcWorker : IWorker
3131
private readonly IOutputBindingsInfoProvider _outputBindingsInfoProvider;
3232
private readonly IMethodInfoLocator _methodInfoLocator;
3333
private readonly IOptions<GrpcWorkerStartupOptions> _startupOptions;
34-
private readonly IOptions<WorkerOptions> _workerOptions;
34+
private readonly ObjectSerializer _serializer;
3535

3636
private Task? _writerTask;
3737
private Task? _readerTask;
@@ -53,7 +53,7 @@ public GrpcWorker(IFunctionsApplication application, FunctionRpcClient rpcClient
5353
_outputBindingsInfoProvider = outputBindingsInfoProvider ?? throw new ArgumentNullException(nameof(outputBindingsInfoProvider));
5454
_methodInfoLocator = methodInfoLocator ?? throw new ArgumentNullException(nameof(methodInfoLocator));
5555
_startupOptions = startupOptions ?? throw new ArgumentNullException(nameof(startupOptions));
56-
_workerOptions = workerOptions ?? throw new ArgumentNullException(nameof(workerOptions));
56+
_serializer = workerOptions.Value.Serializer ?? throw new InvalidOperationException(nameof(workerOptions.Value.Serializer));
5757
}
5858

5959
public Task StartAsync(CancellationToken token)
@@ -119,7 +119,7 @@ private async Task ProcessRequestCoreAsync(StreamingMessage request)
119119
if (request.ContentCase == MsgType.InvocationRequest)
120120
{
121121
responseMessage.InvocationResponse = await InvocationRequestHandlerAsync(request.InvocationRequest, _application,
122-
_invocationFeaturesFactory, _workerOptions.Value.Serializer, _outputBindingsInfoProvider);
122+
_invocationFeaturesFactory, _serializer, _outputBindingsInfoProvider);
123123
}
124124
else if (request.ContentCase == MsgType.WorkerInitRequest)
125125
{

0 commit comments

Comments
 (0)