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

Fix #27: Make sure only one listener is running #32

Merged

Conversation

jacob-carlborg-apoex
Copy link
Contributor

By default, only enable hotwire-spark when starting the Rails server. This prevents starting multiple listeners which can occur if one starts the Rails console or runs a script (rails runner).

Technically it's still possible to run multiple listeners if one explicitly enables hotwire-spark. To prevent this, some form of resource shared between multiple processes are required (like a file lock). This seems to be more complicated than it's worth.

By default, only enable hotwire-spark when starting the Rails server.
This prevents starting multiple listeners which can occur if one
starts the Rails console or runs a script (`rails runner`).
Copy link
Member

@jorgemanrubia jorgemanrubia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a fantastic fix @jacob-carlborg-apoex, thank you so much. Sorry I didn't understand what you meant the other day 🙏. Good test also 👍

@jorgemanrubia jorgemanrubia merged commit 80b02d0 into hotwired:main Dec 20, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants