mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-19 06:31:57 +00:00
linter: couple fixes
This commit is contained in:
+1
-2
@@ -8,7 +8,6 @@ import (
|
||||
"os"
|
||||
"os/signal"
|
||||
"strings"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -18,7 +17,7 @@ var (
|
||||
func TrapSignal(cb func()) {
|
||||
c := make(chan os.Signal, 1)
|
||||
signal.Notify(c, os.Interrupt)
|
||||
signal.Notify(c, syscall.SIGTERM)
|
||||
signal.Notify(c, os.Kill) // nolint: megacheck
|
||||
go func() {
|
||||
for sig := range c {
|
||||
fmt.Printf("captured %v, exiting...\n", sig)
|
||||
|
||||
+7
-9
@@ -140,18 +140,16 @@ func (bs *BaseService) OnStop() {}
|
||||
|
||||
// Implements Service
|
||||
func (bs *BaseService) Reset() (bool, error) {
|
||||
if atomic.CompareAndSwapUint32(&bs.stopped, 1, 0) {
|
||||
// whether or not we've started, we can reset
|
||||
atomic.CompareAndSwapUint32(&bs.started, 1, 0)
|
||||
|
||||
bs.Quit = make(chan struct{})
|
||||
return true, bs.impl.OnReset()
|
||||
} else {
|
||||
if stopped := atomic.CompareAndSwapUint32(&bs.stopped, 1, 0); !stopped {
|
||||
bs.Logger.Debug(Fmt("Can't reset %v. Not stopped", bs.name), "impl", bs.impl)
|
||||
return false, nil
|
||||
}
|
||||
// never happens
|
||||
return false, nil // nolint: vet
|
||||
|
||||
// whether or not we've started, we can reset
|
||||
atomic.CompareAndSwapUint32(&bs.started, 1, 0)
|
||||
|
||||
bs.Quit = make(chan struct{})
|
||||
return true, bs.impl.OnReset()
|
||||
}
|
||||
|
||||
// Implements Service
|
||||
|
||||
Reference in New Issue
Block a user