Skip to content

Commit

Permalink
esm
Browse files Browse the repository at this point in the history
  • Loading branch information
chaudharysaket committed May 7, 2024
1 parent 5334238 commit cfd2f58
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions checks/handler_check.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
Expand Down

0 comments on commit cfd2f58

Please sign in to comment.