Fix max listener warning from livequery server (#7083)

* fix max listner warning

* fix

* Clean test log
This commit is contained in:
Antoine Cormouls
2020-12-21 18:14:07 +01:00
committed by GitHub
parent 41a052c2c3
commit 05f5aa0eb3
2 changed files with 5 additions and 0 deletions

View File

@@ -46,6 +46,10 @@ function createPublisher(): any {
}
function createSubscriber(): any {
// createSubscriber is called once at live query server start
// to avoid max listeners warning, we should clean up the event emitter
// each time this function is called
emitter.removeAllListeners();
return new Subscriber(emitter);
}