Skip to content

Commit

Permalink
fix: return when error happen
Browse files Browse the repository at this point in the history
  • Loading branch information
Ja7ad committed Mar 2, 2024
1 parent e7ef766 commit 2a3d596
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"log"
"os"
"os/exec"
"regexp"
"os/signal"
"regexp"
"strconv"
"sync"
"syscall"
Expand Down Expand Up @@ -70,11 +70,9 @@ func main() {
ctx, cancel := context.WithCancel(context.Background())

defer func() {
log.Println("Exiting...")
os.Exit(0)
}()


for _, val := range cfg.Validators {
args := make([]string, 0)
args = append(args, "--path", cfg.WalletPath, "tx", "bond")
Expand All @@ -100,7 +98,7 @@ func main() {
select {
case s := <-interrupt:
cancel()
log.Printf("task canceled by user, %s", s.String())
log.Printf("staker canceled by user, %s", s.String())
}
}()

Expand All @@ -117,6 +115,7 @@ func runCmd(ctx context.Context, pactusWalletExecPath, validator string, wg *syn
out, err := exec.CommandContext(ctx, pactusWalletExecPath, args...).Output()
if err != nil {
log.Printf("validator: %s err: %s, msg: %s", validator, err.Error(), string(out))
return
}
log.Println(string(out))
}
Expand Down

0 comments on commit 2a3d596

Please sign in to comment.