Skip to content

Commit 71b51a1

Browse files
committed
fix stdout reader
1 parent c54be2a commit 71b51a1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

backend/services/task.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -175,21 +175,21 @@ func SetLogConfig(wg *sync.WaitGroup, cmd *exec.Cmd, t model.Task, u model.User)
175175
spiderLogIndex := viper.GetString("setting.spiderLogIndex")
176176
// get stdout reader
177177
stdout, err := cmd.StdoutPipe()
178-
readerStdout := bufio.NewReader(stdout)
179178
if err != nil {
180179
log.Errorf("get stdout error: %s", err.Error())
181180
debug.PrintStack()
182181
return err
183182
}
183+
readerStdout := bufio.NewReader(stdout)
184184

185185
// get stderr reader
186186
stderr, err := cmd.StderrPipe()
187-
readerStderr := bufio.NewReader(stderr)
188187
if err != nil {
189188
log.Errorf("get stdout error: %s", err.Error())
190189
debug.PrintStack()
191190
return err
192191
}
192+
readerStderr := bufio.NewReader(stderr)
193193

194194
var seq int64
195195
var logs []model.LogItem

0 commit comments

Comments
 (0)