mirror of https://github.com/coder/coder.git
Merge 4142fb3576
into 93d8812284
This commit is contained in:
commit
45cbeaa6ba
|
@ -239,6 +239,12 @@ func (r *RootCmd) provisionerDaemonStart() *serpent.Command {
|
|||
return xerrors.Errorf("shutdown: %w", err)
|
||||
}
|
||||
|
||||
// Shutdown does not call close. Must call it manually.
|
||||
err = srv.Close()
|
||||
if err != nil {
|
||||
return xerrors.Errorf("close server: %w", err)
|
||||
}
|
||||
|
||||
cancel()
|
||||
if xerrors.Is(exitErr, context.Canceled) {
|
||||
return nil
|
||||
|
|
|
@ -236,6 +236,9 @@ func (p *Server) client() (proto.DRPCProvisionerDaemonClient, bool) {
|
|||
select {
|
||||
case <-p.closeContext.Done():
|
||||
return nil, false
|
||||
case <-p.shuttingDownCh:
|
||||
// Shutting down should return a nil client and unblock
|
||||
return nil, false
|
||||
case client := <-p.clientCh:
|
||||
return client, true
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue