You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: avoid starting and stopping spinner loops (#7131)
This was a small regression introduced in #7026.
I didn't quite map the previous lib's API to nanospinner's correctly.
The intent here is to manually control each frame render and each clear. Instead, the
spinner here was already started before it's passed in to this method, then it was cleared
and started again on each chunk - but `start()` here would start a new interval loop and
set up new node.js exit listeners but `clear()` wouldn't clear them (`reset()` does that).
This was leading to unnecessary resource utilization and printing warnings like this:
```
MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGINT listeners added to [process]. MaxListeners is 10. Use emitter.setMaxListeners() to increase limit
(Use node --trace-warnings ... to show where the warning was created)
(node:61086) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGTERM listeners added to [process]. MaxListeners is 10. Use emitter.setMaxListeners() to increase limit
```
The fix here is to just manually render a single frame (`.spin()`) at a time (and `stop()`
the initial loop).
1 commit comments
github-actions[bot] commentedon Mar 25, 2025
📊 Benchmark results