github.com/hechain20/hechain@v0.0.0-20220316014945-b544036ba106/internal/peer/node/signals.go (about)

     1  //go:build !windows
     2  // +build !windows
     3  
     4  /*
     5  Copyright hechain. All Rights Reserved.
     6  
     7  SPDX-License-Identifier: Apache-2.0
     8  */
     9  
    10  package node
    11  
    12  import (
    13  	"os"
    14  	"syscall"
    15  
    16  	"github.com/hechain20/hechain/common/diag"
    17  )
    18  
    19  func addPlatformSignals(sigs map[os.Signal]func()) map[os.Signal]func() {
    20  	sigs[syscall.SIGUSR1] = func() { diag.LogGoRoutines(logger.Named("diag")) }
    21  	return sigs
    22  }