-
Notifications
You must be signed in to change notification settings - Fork 311
fix(watch): Ensure that watch tasks are throttled to run one at a time per watcher. #44
Conversation
@jthoms1 Thank you for this fix! Is it possible that saving a lot of files right after each other creates a huge queue for compiling? Another solution would be to cancel the current task and start a new one right away, instead of waiting for the current task to finish. That should be faster, right? |
Yes this creates a big queue it seems. This fix should resolve that. I would prefer we let the current finish because I don't want to make any assumptions about the current state at any point in time. Just being safe about it. |
Thanks alot! |
@jthoms1 Just had another one with the latest ionic-app-scripts that included this fix:
|
@jthoms1 also got 'Maximum call stack size exceeded' even with version 0.0.27 |
I think it will be necessary to cancel some tasks, maybe conditionally to queue length.
At least, compared to 0.0.23 version, my memory consumption is better. |
This PR should prevent the memory overruns that we have seen from rollup. The code ensures that we are running only watch task at a time by using the returned promises. It also uses a single entry queue so that we only run one additional watch task on previous task completion.