mirror of
https://github.com/buger/goreplay.git
synced 2024-04-21 12:32:02 +00:00
Do not quite on flush error
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime/debug"
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
@@ -208,6 +209,13 @@ func (o *FileOutput) Write(data []byte) (n int, err error) {
|
||||
}
|
||||
|
||||
func (o *FileOutput) flush() {
|
||||
// Don't exit on panic
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
log.Println("PANIC while file flush: ", r, o, string(debug.Stack()))
|
||||
}
|
||||
}()
|
||||
|
||||
defer o.mu.Unlock()
|
||||
o.mu.Lock()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user