mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-24 18:21:38 +00:00
metalinter fixes from review
This commit is contained in:
@ -18,7 +18,7 @@ func TestSIGHUP(t *testing.T) {
|
|||||||
t.Fatalf("Error creating tempfile: %v", err)
|
t.Fatalf("Error creating tempfile: %v", err)
|
||||||
}
|
}
|
||||||
// Here is the actual AutoFile
|
// Here is the actual AutoFile
|
||||||
af, err := cmn.OpenAutoFile(name)
|
af, err := OpenAutoFile(name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Error creating autofile: %v", err)
|
t.Fatalf("Error creating autofile: %v", err)
|
||||||
}
|
}
|
||||||
@ -34,7 +34,8 @@ func TestSIGHUP(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Move the file over
|
// Move the file over
|
||||||
if err := os.Rename(name, name+"_old"); err != nil {
|
err = os.Rename(name, name+"_old")
|
||||||
|
if err != nil {
|
||||||
t.Fatalf("Error moving autofile: %v", err)
|
t.Fatalf("Error moving autofile: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
"strings"
|
"strings"
|
||||||
|
"syscall"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -16,8 +17,7 @@ var (
|
|||||||
|
|
||||||
func TrapSignal(cb func()) {
|
func TrapSignal(cb func()) {
|
||||||
c := make(chan os.Signal, 1)
|
c := make(chan os.Signal, 1)
|
||||||
signal.Notify(c, os.Interrupt)
|
signal.Notify(c, os.Interrupt, syscall.SIGTERM)
|
||||||
signal.Notify(c, os.Kill) // nolint: megacheck
|
|
||||||
go func() {
|
go func() {
|
||||||
for sig := range c {
|
for sig := range c {
|
||||||
fmt.Printf("captured %v, exiting...\n", sig)
|
fmt.Printf("captured %v, exiting...\n", sig)
|
||||||
|
@ -140,7 +140,7 @@ func (bs *BaseService) OnStop() {}
|
|||||||
|
|
||||||
// Implements Service
|
// Implements Service
|
||||||
func (bs *BaseService) Reset() (bool, error) {
|
func (bs *BaseService) Reset() (bool, error) {
|
||||||
if stopped := atomic.CompareAndSwapUint32(&bs.stopped, 1, 0); !stopped {
|
if !atomic.CompareAndSwapUint32(&bs.stopped, 1, 0) {
|
||||||
bs.Logger.Debug(Fmt("Can't reset %v. Not stopped", bs.name), "impl", bs.impl)
|
bs.Logger.Debug(Fmt("Can't reset %v. Not stopped", bs.name), "impl", bs.impl)
|
||||||
return false, nil
|
return false, nil
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user