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

Do not reparse script when its deleted #26

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Burgestrand
Copy link

When using the -e flag, a Tempfile is created. This tempfile will be deleted once ruby GCs (as no reference to the tempfile is held anywhere), which will cause a :deleted event.

Once that happens, watchr will try to reparse the script, going into an endless loop because of a retry call in script.rb, receiving no further events.

This is only a possible solution to it; another option is to store the tempfile in a global variable (to avoid it ever getting GCd, and thus it will be never deleted). Doing it this way won’t guard against the file getting deleted by some other means, however.

Another way would be to finish the noted todo in script.rb, but I don’t know the complications so I decided not to try that :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant