Skip to content

provisionerd sends failed or complete last #2732

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

Merged
merged 5 commits into from
Jul 1, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
renames and slight reworking from code review
Signed-off-by: Spike Curtis <spike@coder.com>
  • Loading branch information
spikecurtis committed Jun 30, 2022
commit cb07b64ec28832bebb5cd8c325a26794c2b7e701
5 changes: 3 additions & 2 deletions provisionerd/provisionerd.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ import (
"sync"
"time"

"cdr.dev/slog"
"github.com/hashicorp/yamux"
"github.com/spf13/afero"
"go.uber.org/atomic"
"golang.org/x/xerrors"

"cdr.dev/slog"

"github.com/coder/coder/provisionerd/proto"
"github.com/coder/coder/provisionerd/runner"
sdkproto "github.com/coder/coder/provisionersdk/proto"
Expand Down Expand Up @@ -235,7 +236,7 @@ func (p *Server) acquireJob(ctx context.Context) {
}
p.activeJob = runner.NewRunner(job, p, p.opts.Logger, p.opts.Filesystem, p.opts.WorkDirectory, provisioner,
p.opts.UpdateInterval, p.opts.ForceCancelInterval)
go p.activeJob.Start()
go p.activeJob.Run()
}

func retryable(err error) bool {
Expand Down
3 changes: 1 addition & 2 deletions provisionerd/provisionerd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,10 @@ func TestMain(m *testing.M) {

func closedWithin(c chan struct{}, d time.Duration) func() bool {
return func() bool {
pop := time.After(d)
select {
case <-c:
return true
case <-pop:
case <-time.After(d):
return false
}
}
Expand Down
Loading