MCPcopy Create free account
hub / github.com/DNAProject/DNA / waitToExit

Function waitToExit

main.go:450–464  ·  view source on GitHub ↗
(db *ledger.Ledger)

Source from the content-addressed store, hash-verified

448}
449
450func waitToExit(db *ledger.Ledger) {
451 exit := make(chan bool, 0)
452 sc := make(chan os.Signal, 1)
453 signal.Notify(sc, syscall.SIGINT, syscall.SIGTERM, syscall.SIGHUP)
454 go func() {
455 for sig := range sc {
456 log.Infof("received exit signal: %v.", sig.String())
457 log.Infof("closing ledger...")
458 db.Close()
459 close(exit)
460 break
461 }
462 }()
463 <-exit
464}

Callers 1

startDNAFunction · 0.85

Calls 4

NotifyMethod · 0.80
InfofMethod · 0.80
CloseMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected