mirror of
https://github.com/serverless/serverless.git
synced 2025-12-08 19:46:03 +00:00
This property was previously missing from the fake lambda context when running ruby functions locally. Ref: https://docs.aws.amazon.com/lambda/latest/dg/ruby-context.html
20 lines
397 B
Ruby
20 lines
397 B
Ruby
def withRemainingTime(event:, context:)
|
|
start = context.get_remaining_time_in_millis()
|
|
sleep(0.001)
|
|
stop = context.get_remaining_time_in_millis()
|
|
|
|
{"start" => start, "stop" => stop}
|
|
end
|
|
|
|
def withDeadlineMs(event:, context:)
|
|
{"deadlineMs" => context.deadline_ms}
|
|
end
|
|
|
|
module MyModule
|
|
class MyClass
|
|
def self.my_class_method(event:, context:)
|
|
{"foo" => "bar"}
|
|
end
|
|
end
|
|
end
|