fix: Prevent duplicate processes when multiple buildRuns run simultaneously #457
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi maintainers, this PR fixes the behavior that air duplicates processses when multiple buildRuns run simultaneously.
Closes #404, Closes #421, Closes #426.
To reproduce issue:
main.go
Run
air -d
and save a file multiple times in a short period of time, then air executes multiple processes.This behavior appears from v1.41.0, and seems to be brought by the following pull request.
I looked into what was making the difference, and it seems that the following code that was in place before the change was important.
https://github.com/cosmtrek/air/blob/d0a697adcf852559ab6fff59aa164b18f62571a0/runner/engine.go#L486-L490
This PR revive that code, and makes