Resolve all high-severity architecture review findings
This commit is contained in:
@@ -701,7 +701,7 @@ public class ScriptRuntimeContext
|
||||
var request = new GetAttributeRequest(
|
||||
correlationId, _instanceName, attributeName, DateTimeOffset.UtcNow);
|
||||
|
||||
var response = await _instanceActor.Ask<GetAttributeResponse>(request, _askTimeout);
|
||||
var response = await _instanceActor.Ask<GetAttributeResponse>(request, _askTimeout).ConfigureAwait(false);
|
||||
|
||||
if (!response.Found)
|
||||
{
|
||||
@@ -762,7 +762,7 @@ public class ScriptRuntimeContext
|
||||
public async Task<bool> WaitAttribute(
|
||||
string name, string? targetValueEncoded, Func<object?, bool>? predicate, TimeSpan timeout,
|
||||
bool requireGoodQuality = false)
|
||||
=> (await WaitInternal(name, targetValueEncoded, predicate, timeout, requireGoodQuality)).Matched;
|
||||
=> (await WaitInternal(name, targetValueEncoded, predicate, timeout, requireGoodQuality).ConfigureAwait(false)).Matched;
|
||||
|
||||
/// <summary>
|
||||
/// WaitForAttribute (spec §3): the richer overload backing <c>Attributes.WaitForAsync</c>
|
||||
@@ -780,7 +780,7 @@ public class ScriptRuntimeContext
|
||||
string name, string? targetValueEncoded, Func<object?, bool>? predicate, TimeSpan timeout,
|
||||
bool requireGoodQuality = false)
|
||||
{
|
||||
var r = await WaitInternal(name, targetValueEncoded, predicate, timeout, requireGoodQuality);
|
||||
var r = await WaitInternal(name, targetValueEncoded, predicate, timeout, requireGoodQuality).ConfigureAwait(false);
|
||||
return new WaitResult(r.Matched, r.Value, r.Quality, r.TimedOut);
|
||||
}
|
||||
|
||||
@@ -816,7 +816,7 @@ public class ScriptRuntimeContext
|
||||
try
|
||||
{
|
||||
response = await _instanceActor.Ask<WaitForAttributeResponse>(
|
||||
req, timeout + _askTimeout, _scriptTimeoutToken);
|
||||
req, timeout + _askTimeout, _scriptTimeoutToken).ConfigureAwait(false);
|
||||
}
|
||||
catch (AskTimeoutException)
|
||||
{
|
||||
@@ -911,7 +911,7 @@ public class ScriptRuntimeContext
|
||||
{
|
||||
// Ask — mutation serialized through the Instance Actor mailbox; the reply
|
||||
// carries the device-write outcome for data-connected attributes.
|
||||
response = await _instanceActor.Ask<SetStaticAttributeResponse>(command, _askTimeout);
|
||||
response = await _instanceActor.Ask<SetStaticAttributeResponse>(command, _askTimeout).ConfigureAwait(false);
|
||||
}
|
||||
catch (Exception ex) when (sw is not null)
|
||||
{
|
||||
@@ -979,7 +979,7 @@ public class ScriptRuntimeContext
|
||||
Guid? stepId = _isTraced ? Guid.NewGuid() : null;
|
||||
using var step = stepId is { } batchStepId ? TraceStepScope.Enter(batchStepId) : null;
|
||||
var batchResp = await _instanceActor.Ask<WriteAttributeBatchResponse>(
|
||||
batchReq, TimeSpan.FromSeconds(35), _scriptTimeoutToken);
|
||||
batchReq, TimeSpan.FromSeconds(35), _scriptTimeoutToken).ConfigureAwait(false);
|
||||
|
||||
if (sw is not null)
|
||||
{
|
||||
@@ -1003,7 +1003,7 @@ public class ScriptRuntimeContext
|
||||
throw new InvalidOperationException(
|
||||
$"WriteBatchAndWait write failed: {batchResp.ErrorMessage}");
|
||||
|
||||
return await WaitAttribute(responseAttr, responseEncoded, null, timeout);
|
||||
return await WaitAttribute(responseAttr, responseEncoded, null, timeout).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user