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.
This PR is based on #147 (that's why those commits are in there as well. Will need to rebase after merging that PR).
This change ensures that the restic repository is always available and set on jobs which is required for the queue to be able to detect which jobs are running against which repository. It adds a test related to this case to document and ensure what the execution queue does works.
Additionally it refactors to have a type for the possible job types.
I'm not entirely sure if this solves #118 already. There's code (worker.go) which ensures a job isn't run if there's another exclusive job running or an exclusive job isn't running if there is any other job running.
However that same code also is probably misbehaving (I'd still have to check, or rather: one should write a test for this):
shouldRun
-> falseAt this point job B is never run, as it's gone from the queue and doesn't get re-added.
Correct me if I misinterpret the code please :)