mirror of
https://github.com/JKorf/CryptoExchange.Net
synced 2026-04-07 02:01:12 +00:00
Fix for websocket queries which don't expects response getting stuck in subscribing state
This commit is contained in:
parent
297eee0e1f
commit
419e01d009
@ -170,6 +170,6 @@ namespace CryptoExchange.Net.Objects.Sockets
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override string ToString() => base.ToString().TrimEnd('-') + Data?.ToString();
|
||||
public override string ToString() => base.ToString().TrimEnd(' ', '-') + " - " + Data?.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1137,7 +1137,7 @@ namespace CryptoExchange.Net.Sockets.Default
|
||||
return CallResult.SuccessResult;
|
||||
}
|
||||
|
||||
subQuery.OnComplete = () =>
|
||||
var subCompleteHandler = () =>
|
||||
{
|
||||
subscription.Status = subQuery.Result!.Success ? SubscriptionStatus.Subscribed : SubscriptionStatus.Pending;
|
||||
subscription.HandleSubQueryResponse(this, subQuery.Response);
|
||||
@ -1150,6 +1150,7 @@ namespace CryptoExchange.Net.Sockets.Default
|
||||
}, false);
|
||||
}
|
||||
};
|
||||
subQuery.OnComplete = subCompleteHandler;
|
||||
|
||||
var subQueryResult = await SendAndWaitQueryAsync(subQuery).ConfigureAwait(false);
|
||||
if (!subQueryResult)
|
||||
@ -1161,6 +1162,9 @@ namespace CryptoExchange.Net.Sockets.Default
|
||||
return new CallResult<UpdateSubscription>(subQueryResult.Error!);
|
||||
}
|
||||
|
||||
if (!subQuery.ExpectsResponse)
|
||||
subCompleteHandler();
|
||||
|
||||
return subQueryResult;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user