mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-13 15:09:42 +00:00
engine: GetSubsystemsStatus fix (#773)
* engine: GetSubsystemsStatus fix * engine: force map literal to stop doubling up on keys, expanded test coverage * engine: Deploy default for migration requirement. * glorious: nits addr * glorious: suggestion * tests: fix
This commit is contained in:
@@ -11,6 +11,9 @@ import (
|
||||
"github.com/thrasher-corp/gocryptotrader/log"
|
||||
)
|
||||
|
||||
// ErrNotRunning defines an error when the dispatcher is not running
|
||||
var ErrNotRunning = errors.New("dispatcher not running")
|
||||
|
||||
// Name is an exported subsystem name
|
||||
const Name = "dispatch"
|
||||
|
||||
@@ -117,7 +120,7 @@ func (d *Dispatcher) start(workers, channelCapacity int) error {
|
||||
// stop stops the service and shuts down all worker routines
|
||||
func (d *Dispatcher) stop() error {
|
||||
if !atomic.CompareAndSwapUint32(&d.running, 1, 0) {
|
||||
return errors.New("dispatcher not running")
|
||||
return ErrNotRunning
|
||||
}
|
||||
close(d.shutdown)
|
||||
ch := make(chan struct{})
|
||||
|
||||
Reference in New Issue
Block a user