fix: Don't use StatusAbnormalClosure (#4155)

This commit is contained in:
Kyle Carberry
2022-09-22 13:26:05 -05:00
committed by GitHub
parent 9e099b543f
commit a7ee8b31e0
17 changed files with 62 additions and 34 deletions

View File

@ -4,6 +4,7 @@ import (
"context"
"errors"
"fmt"
"io"
"os"
"strings"
"time"
@ -100,7 +101,7 @@ func main() {
Fetch: func() (codersdk.ProvisionerJob, error) {
return job, nil
},
Logs: func() (<-chan codersdk.ProvisionerJobLog, error) {
Logs: func() (<-chan codersdk.ProvisionerJobLog, io.Closer, error) {
logs := make(chan codersdk.ProvisionerJobLog)
go func() {
defer close(logs)
@ -143,7 +144,7 @@ func main() {
}
}
}()
return logs, nil
return logs, io.NopCloser(strings.NewReader("")), nil
},
Cancel: func() error {
job.Status = codersdk.ProvisionerJobCanceling