Browse Source

En cours de développement

master
losyme 2 months ago
parent
commit
3747144cbf
  1. 12
      internal/application/application.go
  2. 4
      internal/demo/demo.go

12
internal/application/application.go

@ -74,10 +74,14 @@ func (app *Application) Run() error {
return errors.WithMessage(err, "API") //////////////////////////////////////////////////////////////////
}
cs := app.components
if app.cmdLine.demo {
if err := app.demo(); err != nil {
return errors.WithMessage(err, "demo") /////////////////////////////////////////////////////////////
}
cs.Demo.Start()
}
app.components.Scheduler.Start()
@ -85,7 +89,13 @@ func (app *Application) Run() error {
return nil
},
func() { // atEnd................................................................................................
<-app.components.Scheduler.Stop().Done()
cs := app.components
<-cs.Scheduler.Stop().Done()
if app.cmdLine.demo {
cs.Demo.Stop()
}
},
)
}

4
internal/demo/demo.go

@ -15,7 +15,7 @@ import (
const _workerPoolSize = 2
type Demo struct {
workers *workers.Workers
*workers.Workers
}
func New(namespace string, logger *logger.Component, model runner.Model) (*Demo, error) {
@ -33,7 +33,7 @@ func New(namespace string, logger *logger.Component, model runner.Model) (*Demo,
}
demo := &Demo{
workers: workers,
Workers: workers,
}
return demo, nil

Loading…
Cancel
Save