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

feat(remove/job): remove a particular job reference from the schedule… #90

Merged
merged 1 commit into from
Dec 16, 2020

Conversation

dlaweb
Copy link

@dlaweb dlaweb commented Dec 14, 2020

…r after the last execution of the job

What does this do?

With the scheduler we have the possibility to run a Job only once but when the Job has finished its execution we still have a reference in the Scheduler while it will not be used anymore this can lead to keep obsoletes scheduler Jobs references.

This PR allow the user to add a flag RemoveAfterLastExec in order to remove the job after the last job execution.

Which issue(s) does this PR fix/relate to?

resolves #85

List any changes that modify/break current functionality

Have you included tests for your changes?

Yes

Did you document any new/modified functionality?

  • Updated example_test.go
  • Updated README.md

Notes

@dlaweb dlaweb force-pushed the remove_job_after_exec branch from 6ed05ca to 0723269 Compare December 14, 2020 18:19
job.go Outdated Show resolved Hide resolved
scheduler.go Outdated Show resolved Hide resolved
scheduler_test.go Outdated Show resolved Hide resolved
scheduler_test.go Outdated Show resolved Hide resolved
@JohnRoesler
Copy link
Contributor

Thanks for the feature PR!

job.go Outdated Show resolved Hide resolved
@dlaweb dlaweb force-pushed the remove_job_after_exec branch 2 times, most recently from 40d23a9 to 78817be Compare December 15, 2020 17:54
scheduler_test.go Outdated Show resolved Hide resolved
scheduler_test.go Outdated Show resolved Hide resolved
@dlaweb dlaweb force-pushed the remove_job_after_exec branch from 78817be to 9e9b239 Compare December 15, 2020 17:59
@dlaweb dlaweb changed the title WIP: feat(remove/job): remove a particular job reference from the schedule… feat(remove/job): remove a particular job reference from the schedule… Dec 15, 2020
@dlaweb dlaweb force-pushed the remove_job_after_exec branch from 9e9b239 to 48ec719 Compare December 15, 2020 18:06
JohnRoesler
JohnRoesler previously approved these changes Dec 15, 2020
@JohnRoesler JohnRoesler dismissed their stale review December 15, 2020 19:27

please add a test to the example_test.go file so that it appears in the go docs

@dlaweb dlaweb force-pushed the remove_job_after_exec branch from 48ec719 to 61a8323 Compare December 16, 2020 20:36
@dlaweb dlaweb force-pushed the remove_job_after_exec branch from 61a8323 to 836d0ae Compare December 16, 2020 20:49
@JohnRoesler
Copy link
Contributor

Thank you!

@JohnRoesler JohnRoesler merged commit f0a0fc2 into go-co-op:master Dec 16, 2020
@apremalal
Copy link

Hi, Thanks for adding this feature. Is it possible to create a release tag with this change?

@JohnRoesler
Copy link
Contributor

@apremalal yes we are working on a release soon. This feature may change slightly before the release, but the functionality will be available.

@JohnRoesler
Copy link
Contributor

@Streppel you had mentioned why not just remove after the run limit is reached. I think having this available as is with a specific flag is valuable, because a user may not be default want to remove the job. For example, start a job with a limit of 1 run, then later edit the run limit to 2, and then later 3, etc. With this flag, we allow specifically asking to remove the job after the limit is reached.

@Streppel
Copy link
Member

@JohnRoesler I see... Let's keep it that way, then; I think this makes sense. Even though, creating a new job would be a simpler way of achieving the same result, right?

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] - Remove Job from Scheduler Jobs when the Job is supposed to be launch only once.
5 participants