feat(lifecycle-module): add debug message for onInit() execution
arcad/edge/pipeline/head This commit looks good Details

This commit is contained in:
wpetit 2023-10-21 21:46:51 +02:00
parent de4ab0d02c
commit 0cfb132b65
1 changed files with 5 additions and 0 deletions

View File

@ -2,6 +2,7 @@ package module
import ( import (
"context" "context"
"time"
"forge.cadoles.com/arcad/edge/pkg/app" "forge.cadoles.com/arcad/edge/pkg/app"
"github.com/dop251/goja" "github.com/dop251/goja"
@ -41,7 +42,11 @@ func (m *LifecycleModule) OnInit(ctx context.Context, rt *goja.Runtime) (err err
} }
}() }()
logger.Debug(ctx, "executing app onInit() function")
start := time.Now()
call(nil) call(nil)
duration := time.Since(start)
logger.Debug(ctx, "executed app onInit() function", logger.F("duration", duration.String()))
return nil return nil
} }