Fixing log and statements
This commit is contained in:
parent
6e784024b8
commit
46da4ba469
|
@ -265,11 +265,12 @@ func (e *UniversalExecutor) UpdateTask(task *structs.Task) error {
|
||||||
e.lre.MaxFiles = task.LogConfig.MaxFiles
|
e.lre.MaxFiles = task.LogConfig.MaxFiles
|
||||||
e.lre.FileSize = fileSize
|
e.lre.FileSize = fileSize
|
||||||
|
|
||||||
|
var err error
|
||||||
// Re-syncing task with consul service
|
// Re-syncing task with consul service
|
||||||
if e.consulService != nil {
|
if e.consulService != nil {
|
||||||
e.consulService.SyncTask(task)
|
err = e.consulService.SyncTask(task)
|
||||||
}
|
}
|
||||||
return nil
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e *UniversalExecutor) wait() {
|
func (e *UniversalExecutor) wait() {
|
||||||
|
@ -349,7 +350,7 @@ func (e *UniversalExecutor) ShutDown() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e *UniversalExecutor) RegisterServices() error {
|
func (e *UniversalExecutor) RegisterServices() error {
|
||||||
e.logger.Printf("executor: registering services")
|
e.logger.Printf("[INFO] executor: registering services")
|
||||||
if e.consulService == nil {
|
if e.consulService == nil {
|
||||||
cs, err := consul.NewConsulService(e.ctx.ConsulConfig, e.logger, e.ctx.AllocID)
|
cs, err := consul.NewConsulService(e.ctx.ConsulConfig, e.logger, e.ctx.AllocID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -358,15 +359,12 @@ func (e *UniversalExecutor) RegisterServices() error {
|
||||||
e.consulService = cs
|
e.consulService = cs
|
||||||
}
|
}
|
||||||
err := e.consulService.SyncTask(e.ctx.Task)
|
err := e.consulService.SyncTask(e.ctx.Task)
|
||||||
if err != nil {
|
|
||||||
e.logger.Printf("executor: error registering services: %v", err)
|
|
||||||
}
|
|
||||||
go e.consulService.SyncWithConsul()
|
go e.consulService.SyncWithConsul()
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e *UniversalExecutor) DeregisterServices() error {
|
func (e *UniversalExecutor) DeregisterServices() error {
|
||||||
e.logger.Printf("executor: de-registering services and shutting down consul service")
|
e.logger.Printf("[ERR] executor: de-registering services and shutting down consul service")
|
||||||
if e.consulService != nil {
|
if e.consulService != nil {
|
||||||
return e.consulService.Shutdown()
|
return e.consulService.Shutdown()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue