Merge pull request #11024 from thingsboard/fix/subs-cleanup
Refactor stale subs cleanup on ClusterTopologyChangeEvent
This commit is contained in:
		
						commit
						736eb0373d
					
				@ -155,7 +155,15 @@ public class DefaultTbLocalSubscriptionService implements TbLocalSubscriptionSer
 | 
			
		||||
                }
 | 
			
		||||
            });
 | 
			
		||||
            if (!staleSubs.isEmpty()) {
 | 
			
		||||
                staleSubs.forEach(subscriptionsByEntityId::remove);
 | 
			
		||||
                subsLock.lock();
 | 
			
		||||
                try {
 | 
			
		||||
                    staleSubs.forEach(entityId -> {
 | 
			
		||||
                        subscriptionsByEntityId.remove(entityId);
 | 
			
		||||
                        entityUpdates.remove(entityId);
 | 
			
		||||
                    });
 | 
			
		||||
                } finally {
 | 
			
		||||
                    subsLock.unlock();
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user