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

Skip jobs with unchanged dependencies #4

Open
reynoldsbd opened this issue Oct 17, 2020 · 1 comment
Open

Skip jobs with unchanged dependencies #4

reynoldsbd opened this issue Oct 17, 2020 · 1 comment

Comments

@reynoldsbd
Copy link
Owner

This feature has two parts:

  1. Allow individual jobs to report an unchanged outcome
  2. If all of a job's dependencies reported unchanged, then skip execution of that job and set its outcome to unchanged as well

For part 1, create a new enum:

#[non_exhaustive] // so we can add more outcomes in the future
pub enum Outcome {
    Success,
    Unchanged,
}

Change return type of Job::run to Result<Outcome, Self::Error>

Update JobState::Succeeded variant to include outcome value

For part 2, update Schedule::mark_complete to accept the full Result of job run and store job outcome appropriately. Also add logic to recursively set unchanged outcome for dependent jobs

@reynoldsbd
Copy link
Owner Author

Open question: Does this need to be configurable?

I don't think so. If an implementation of Job wishes to avoid this behavior it can simply choose not to return Outcome::Unchanged.

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

No branches or pull requests

1 participant