Skip to content

Commit

Permalink
no more panic
Browse files Browse the repository at this point in the history
Signed-off-by: lob <[email protected]>
  • Loading branch information
lobshunter committed Oct 12, 2021
1 parent a75c563 commit 77d781a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion components/bench/misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"context"
"fmt"
"os"
"sync"
"time"

Expand Down Expand Up @@ -106,7 +107,8 @@ func executeWorkload(ctx context.Context, w workload.Workloader, threads int, ac
defer wg.Done()
if err := execute(ctx, w, action, threads, index); err != nil {
if action == "prepare" {
panic(fmt.Sprintf("a fatal occurred when preparing data: %v", err))
fmt.Printf("a fatal occurred when preparing data: %v\n", err)
os.Exit(1)
}
fmt.Printf("execute %s failed, err %v\n", action, err)
return
Expand Down

0 comments on commit 77d781a

Please sign in to comment.