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

Avoid double builds on OSX #3

Merged
merged 1 commit into from
Jul 15, 2015
Merged

Avoid double builds on OSX #3

merged 1 commit into from
Jul 15, 2015

Conversation

kalafut
Copy link
Contributor

@kalafut 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.

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
Copy link

lcowell commented Mar 11, 2015

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

@Tonkpils Tonkpils mentioned this pull request Jul 15, 2015
levicook added a commit that referenced this pull request Jul 15, 2015
Avoid double builds on OSX
@levicook levicook merged commit c47a167 into levicook:master Jul 15, 2015
@levicook
Copy link
Owner

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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants