From cfd2f58b9359f9aa7ce45aaa2e57a9e87855bbdf Mon Sep 17 00:00:00 2001 From: Saket Chaudhary Date: Tue, 7 May 2024 17:15:14 +0530 Subject: [PATCH] esm --- checks/handler_check.go | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/checks/handler_check.go b/checks/handler_check.go index 91a44bf..e214deb 100644 --- a/checks/handler_check.go +++ b/checks/handler_check.go @@ -34,6 +34,15 @@ func handlerCheck(ctx context.Context, conf *config.Configuration, reg *api.Regi } func (r runtimeConfig) check(h handlerConfigs) bool { + if !h.conf.TestingOverride { + esm := strings.ToLower(os.Getenv("NEW_RELIC_USE_ESM")) + if esm == "true" { + return true + } + if isDockerEnvironment() { + return true + } + } functionHandler := r.getTrueHandler(h) p := removePathMethodName(functionHandler) if r.language == Node { @@ -51,16 +60,6 @@ func (r runtimeConfig) check(h handlerConfigs) bool { } func (r runtimeConfig) getTrueHandler(h handlerConfigs) string { - if !h.conf.TestingOverride { - esm := strings.ToLower(os.Getenv("NEW_RELIC_USE_ESM")) - if esm == "true" { - return h.handlerName - } - if isDockerEnvironment() { - return h.handlerName - } - } - if h.handlerName != r.wrapperName { util.Logln("Warning: handler not set to New Relic layer wrapper", r.wrapperName) return h.handlerName