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: add contexts to interfaces #41

Merged
merged 5 commits into from
Dec 22, 2022
Merged

Conversation

tychoish
Copy link
Contributor

@tychoish tychoish commented Dec 20, 2022

I still want to do some work to add test coverage of this, and potentially exercise the new signal channel, but I'm pretty confident in the general approach, and wanted to get some early feedback.

Addresses: #40

@codecov-commenter
Copy link

codecov-commenter commented Dec 21, 2022

Codecov Report

Merging #41 (8ac6bea) into master (56c412a) will decrease coverage by 0.26%.
The diff coverage is 92.75%.

❗ Current head 8ac6bea differs from pull request most recent head 4f075bb. Consider uploading reports for the commit 4f075bb to get more accurate results

@@            Coverage Diff             @@
##           master      #41      +/-   ##
==========================================
- Coverage   83.38%   83.12%   -0.27%     
==========================================
  Files           7        7              
  Lines         620      634      +14     
==========================================
+ Hits          517      527      +10     
- Misses         71       78       +7     
+ Partials       32       29       -3     
Impacted Files Coverage Δ
quartz/scheduler.go 89.43% <92.06%> (-1.27%) ⬇️
quartz/function_job.go 67.85% <100.00%> (+17.85%) ⬆️
quartz/job.go 78.18% <100.00%> (-10.71%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@tychoish
Copy link
Contributor Author

I've added tests, and think this is mostly ready to go, modulo any changes that you think are good.

quartz/scheduler.go Show resolved Hide resolved
}

func (sched *StdScheduler) startExecutionLoop() {
func (sched *StdScheduler) startExecutionLoop(ctx context.Context) {

Copy link
Owner

Choose a reason for hiding this comment

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

Redundant new line.

}
}
for _, tt := range []string{"context", "stop"} {
if tt == "stop" {
Copy link
Owner

Choose a reason for hiding this comment

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

Requires time.Sleep in both cases. Otherwise, it fails locally.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

interesting. It passes locally for me, but my machine is linux and kind of a beast, but I took out if statement.

quartz/scheduler_test.go Show resolved Hide resolved
@tychoish tychoish requested a review from reugn December 22, 2022 15:17
@reugn reugn merged commit d16e8d9 into reugn:master Dec 22, 2022
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.

3 participants