Event listener cleanup
# 💻|contributing
p
I was wondering if we know where the large amount of event listeners come from that cause messages like this: https://discord.com/channels/817392104711651328/1155888568242274325/1158477947947204671 Is that by design and required or do we just never clean up any listeners when they aren't needed anymore?
b
This is definitely not by design. Especially not in this case. I'd be curious to know more about the project and if it's e.g. unusally large. (I've seen this happen when the ws server runs for a long time and a lot of Garden instances are created due to command requests from the API but I think that was fixed and in any case is a different scenario from this one)
p
This happens even just when you have a large project and run
validate
on it
I suspect the whole graph resolution thing somewhere attaches a whole bunch of event listeners on the different modules, but then doesn't really clean up once whatever they listened for was completed
b
Yeah, sounds like it Does it only happen for the
validate
command though? Sounds like it should happen for most commands since only thing
validate
really does is resolve the config.