Assorted bug fixes
This commit is contained in:
10
phases.go
10
phases.go
@@ -200,7 +200,7 @@ func (this *environment) phase50ConfigurationApplication() bool {
|
||||
defer done()
|
||||
for _, actor := range sortActors(actors, actors.configurable.all()) {
|
||||
if !actors.info(actor.(Actor)).initial { continue }
|
||||
if this.Verb() { log.Println ("... (50) applying configuration to %s", actor.(Actor).Type())}
|
||||
if this.Verb() { log.Printf ("... (50) applying configuration to %s", actor.(Actor).Type())}
|
||||
err := actor.Configure(this.conf)
|
||||
if err != nil {
|
||||
log.Printf (
|
||||
@@ -288,15 +288,14 @@ func (this *environment) phase70RunningBody() bool {
|
||||
}()
|
||||
log.Println(".// (70) startup sequence complete")
|
||||
// await context cancellation or waitgroup completion
|
||||
wgChannel := make(chan struct { }, 1)
|
||||
go func() {
|
||||
this.group.Wait()
|
||||
wgChannel <- struct { } { }
|
||||
close(this.noneLeft)
|
||||
}()
|
||||
select {
|
||||
case <- this.ctx.Done():
|
||||
if this.Verb() { log.Println("(i) (70) canceled") }
|
||||
case <- wgChannel:
|
||||
case <- this.noneLeft:
|
||||
if this.Verb() { log.Println("(i) (70) all actors have finished") }
|
||||
}
|
||||
return true
|
||||
@@ -358,6 +357,7 @@ func (this *environment) phase80Shutdown() bool {
|
||||
log.Println(".// (80) shutdown succeeded, goodbye")
|
||||
log.Printf("====== [%s] END =======", this.name)
|
||||
}()
|
||||
this.group.Wait()
|
||||
// wait for all actors to shut down
|
||||
<- this.noneLeft
|
||||
return cause == nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user