()
| 537 | } |
| 538 | |
| 539 | func (e *engineImpl) Close() { |
| 540 | e.log.Debug("engine close") |
| 541 | e.tomb.Kill(nil) |
| 542 | e.tomb.Wait() |
| 543 | if e.pb != nil { |
| 544 | err := e.pb.Unsubscribe(sync.TopicDownside, e.downsideChan) |
| 545 | if err != nil { |
| 546 | e.log.Warn("failed to unsubscribe topic downside") |
| 547 | } |
| 548 | } |
| 549 | if e.downsideProcess != nil { |
| 550 | e.downsideProcess.Close() |
| 551 | } |
| 552 | } |
| 553 | |
| 554 | func genSystemCert(sec security.Security) error { |
| 555 | appName := os.Getenv(context.KeyAppName) |