mirror of
https://github.com/uqbar-dao/nectar.git
synced 2024-11-30 11:53:33 +03:00
hotfix2: overwrite existing subscription if ID is reused
This commit is contained in:
parent
7d01dcfcae
commit
74f8fda9ce
@ -119,9 +119,9 @@ async fn handle_request(
|
||||
match action {
|
||||
EthAction::SubscribeLogs { sub_id, filter } => {
|
||||
let sub_id = (target.process.clone(), sub_id);
|
||||
if connections.ws_provider_subscriptions.contains_key(&sub_id) {
|
||||
return Err(EthError::SubscriptionIdCollision);
|
||||
}
|
||||
|
||||
// if this process has already used this subscription ID,
|
||||
// this subscription will **overwrite** the existing one.
|
||||
|
||||
let handle = tokio::spawn(handle_subscription_stream(
|
||||
our.clone(),
|
||||
|
@ -23,8 +23,6 @@ pub enum EthAction {
|
||||
/// and `serde_json::from_slice`.
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
pub enum EthError {
|
||||
/// The subscription ID already existed
|
||||
SubscriptionIdCollision,
|
||||
/// The ethers provider threw an error when trying to subscribe
|
||||
/// (contains ProviderError serialized to debug string)
|
||||
ProviderError(String),
|
||||
|
Loading…
Reference in New Issue
Block a user