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

don't kill jobs on every change #207

Merged
merged 5 commits into from
Sep 13, 2024
Merged

don't kill jobs on every change #207

merged 5 commits into from
Sep 13, 2024

Conversation

Canop
Copy link
Owner

@Canop Canop commented Sep 7, 2024

This PR brings 2 settings:

With show_changes_count = true, you can see the number of file changes that occurred since last job start.

The on_change_strategy setting lets you define how bacon reacts to a change, with two possible values:

  • With on_change_strategy = "kill_then_restart", the current job is immediately killed and a new job restarted. This is the behavior that bacon had before this PR. It has the downside of never allowing any job to complete if you're always changing files and the job is just a little too long to finish between changes.

  • With on_change_strategy = "wait_then_restart" (which is the new default, so you can omit it), bacon waits for the job to finish before restarting it. This is probably much better when the jobs aren't instant and you want to continue changing files while it's computing.

The on_change_strategy can be defined in the global prefs, in the project settings, and even for a specific job.

Fix #206

This changes the job running strategy.

Previously, the current running job was killed as soon as there was a
change, to allow a faster execution of the new job.

This had the downside of never allowing any job to complete if you were
always changing files and the job were just a little too long to finish
between changes.

With the new strategy, bacon lets the job finish (unless you ask for a
refresh or change the mission), display the result, and if some changes
occured after the last job start, then start a new job.

Also, the number of changes since the last job *start* is displayed
(this display should become opt-in before merging into main)
(note: it's the number of events, not of modified files)

Fix #206
@Canop Canop marked this pull request as ready for review September 8, 2024 17:52
@Canop Canop merged commit 1ec4044 into main Sep 13, 2024
@Canop
Copy link
Owner Author

Canop commented Sep 14, 2024

released in 2.21.0

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.

Feature Suggestion: Show number of files changed since last run in header line
1 participant