Engine improvements

This commit is contained in:
Adrian Gallagher
2019-06-10 20:02:09 +10:00
parent 04c7c4895f
commit f777e68716
88 changed files with 2037 additions and 1413 deletions

View File

@@ -7,6 +7,7 @@ import (
"os"
"os/signal"
"path"
"sync"
"syscall"
"time"
@@ -40,6 +41,7 @@ type Engine struct {
Settings Settings
CryptocurrencyDepositAddresses map[string]map[string]string
Uptime time.Time
ServicesWG sync.WaitGroup
}
// Vars for engine
@@ -436,6 +438,8 @@ func (e *Engine) Stop() {
log.Debugln("Config file saved successfully.")
}
}
// Wait for services to gracefully shutdown
e.ServicesWG.Wait()
log.Debugln("Exiting.")
log.CloseLogFile()
os.Exit(0)