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

fix RunNow() when calling from a job returned by Jobs() #668

Merged
merged 1 commit into from
Feb 2, 2024

Conversation

JohnRoesler
Copy link
Contributor

What does this do?

Jobs() needs to return the run now channel in order to enable jobs to use RunNow

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

resolves #667

List any changes that modify/break current functionality

Have you included tests for your changes?

Did you document any new/modified functionality?

  • Updated example_test.go
  • Updated README.md

Notes

Comment on lines +457 to +461
in.id,
in.name,
slices.Clone(in.tags),
s.jobOutRequestCh,
s.runJobRequestCh,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

switched this to not used named struct parameters so a future build will break if a new field is added to job but not populated here

Comment on lines +1532 to +1535
_, err := s.NewJob(tt.j, NewTask(tt.fun), tt.opts...)
require.NoError(t, err)

j := s.Jobs()[0]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updating this test to validate the exact behavior seen in the issue.

@JohnRoesler JohnRoesler merged commit b1ffc66 into v2 Feb 2, 2024
3 checks passed
@JohnRoesler JohnRoesler deleted the fix-Jobs-RunNow branch February 2, 2024 15:46
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.

BUG: gocron: Job: RunNow: scheduler unreachable
1 participant