Skip to content

Commit

Permalink
testing
Browse files Browse the repository at this point in the history
  • Loading branch information
steebchen committed Feb 21, 2024
1 parent af753c7 commit c57fe9c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions engine/stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"
"log"
"os/exec"
"sync"

"github.com/steebchen/prisma-client-go/logger"
)
Expand All @@ -21,12 +22,16 @@ func (e *QueryEngine) streamStderr(cmd *exec.Cmd, onError chan<- string) error {
return fmt.Errorf("get stderr pipe: %w", err)
}

mu := &sync.Mutex{}

go func() {
outer:
for {
select {
case v := <-e.onEngineError:
mu.Lock()
e.lastEngineError = v
mu.Unlock()
case <-e.closed:
logger.Debug.Printf("query engine closed")
break outer
Expand Down

0 comments on commit c57fe9c

Please sign in to comment.