Skip to content

Way to execute code on shutdown? #318

@mikeparker

Description

@mikeparker

I want to maintain an event metrics client across multiple lambda invocations so the server does not get spammed. However, I need to be able to flush the queue on shutdown.

Does the AWS go lib have any way to execute code on shutdown? If I simply add code to the end of main (after the lambda.Start), or using defer, will it get executed?

From viewing the code it looks like the main method will finish if there is a runtime error, but I'm unsure what happens if the lambda gets shutdown - I could not see code for dealing with a shutdown message (I dont think it gets a SIGTERM?)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions