Skip to content

Commit

Permalink
esm (#209)
Browse files Browse the repository at this point in the history
  • Loading branch information
chaudharysaket authored May 13, 2024
1 parent cf86fb5 commit a8461c8
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions checks/handler_check.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ 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
}
}
functionHandler := r.getTrueHandler(h)
p := removePathMethodName(functionHandler)
if r.language == Node {
Expand All @@ -52,10 +58,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 util.PathExists("/.dockerenv") {
return h.handlerName
}
Expand Down

0 comments on commit a8461c8

Please sign in to comment.