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

Avoid double builds on OSX #3

Merged
merged 1 commit into from Jul 15, 2015

Conversation

Projects
None yet
3 participants
@kalafut
Contributor

kalafut commented Jan 11, 2015

Thanks for glitch. It's useful.

I noticed that every file save was generating multiple builds. It's most likely due to double events from OSX + Spotlight (howeyc/fsnotify#62). This commit addresses it by testing whether the file's mtime is different, which it isn't under this double event scenario.

The change also fixes a bug in the buildQueued logic. The variable was simply getting set to the most recent hasSuffix() call, which would fail to trigger a build if a non-Go file was modified last. You can see this with: touch app.go; touch readme.txt. The buildQueued state should latch to true.

Avoid double builds on OSX
A single file change may trigger multiple events on OSX that are seconds apart,
which will then cause multiple builds. This commit tests whether the mtime
actually changed.
@lcowell

This comment has been minimized.

lcowell commented Mar 11, 2015

I used @kalafut 's build and it appears to have cleared up the double-build issue. 👍

@Tonkpils Tonkpils referenced this pull request Jul 15, 2015

Closed

Maintenance Status #5

levicook added a commit that referenced this pull request Jul 15, 2015

Merge pull request #3 from kalafut/master
Avoid double builds on OSX

@levicook levicook merged commit c47a167 into levicook:master Jul 15, 2015

@levicook

This comment has been minimized.

Owner

levicook commented Jul 15, 2015

No idea how I missed these -- buried in my inbox, I guess. Sorry for the delay and thank you for the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment