Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hot reload: manage event listeners, video processes #48

Open
2 tasks
northamerican opened this issue Aug 22, 2024 · 0 comments
Open
2 tasks

hot reload: manage event listeners, video processes #48

northamerican opened this issue Aug 22, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@northamerican
Copy link
Owner

northamerican commented Aug 22, 2024

on hot reload

  • prevent events from running again
    (node:78832) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 videos:write listeners added to [EventEmitter]. Use emitter.setMaxListeners() to increase limit
  • manage / prevent / kill ffmpeg processes

this is just for development, so don't have a big shit.

see: https://vitejs.dev/guide/api-hmr

something like this

if (import.meta.hot) {
  import.meta.hot.accept();
  import.meta.hot.dispose(() => {
    // Clear timeouts, intervals, or any other cleanup tasks
    clearTimeout(yourTimeout);
    clearInterval(yourInterval);
    // Perform other necessary cleanup tasks here
  });
@northamerican northamerican added the bug Something isn't working label Aug 22, 2024
@northamerican northamerican changed the title reset event listeners on hot reload hot reload: manage event listeners, video processes Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant