Skip to content

Commit

Permalink
Use environment variable to find function name than context
Browse files Browse the repository at this point in the history
  • Loading branch information
elct9620 committed Jan 9, 2024
1 parent 00849d2 commit fb1057b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/hanami/lambda/dispatcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def call(event:, context:)
#
# @return [Handler] the handler
def lookup(event:, context:) # rubocop:disable Lint/UnusedMethodArgument
function_name = context.function_name
function_name = ENV.fetch("AWS_LAMBDA_FUNCTION_NAME", context.function_name)
handlers
.select { |name, _| function_name.include?(name) }
.max_by { |name, _| name.length }
Expand Down

0 comments on commit fb1057b

Please sign in to comment.