mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-04-05 14:45:58 +08:00
Revert "avoid data race on grace.hooks (#3572)"
This reverts commit c37d6fc01a
.
This commit is contained in:
parent
c37d6fc01a
commit
d1bb23645e
@ -12,7 +12,7 @@ import (
|
||||
|
||||
var signalChan chan os.Signal
|
||||
var hooks = make([]func(), 0)
|
||||
var hookLock sync.RWMutex
|
||||
var hookLock sync.Mutex
|
||||
|
||||
func init() {
|
||||
signalChan = make(chan os.Signal, 1)
|
||||
@ -27,9 +27,7 @@ func init() {
|
||||
// syscall.SIGQUIT,
|
||||
)
|
||||
go func() {
|
||||
hookLock.RLock()
|
||||
defer hookLock.RUnlock()
|
||||
for range signalChan {
|
||||
for _ = range signalChan {
|
||||
for _, hook := range hooks {
|
||||
hook()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user