Skip to content

Persistence with AWS Lambda #4015

Answered by ubertao
ubertao asked this question in Q&A
Dec 18, 2023 · 2 comments · 7 replies
Discussion options

You must be logged in to vote

Adding async with app: will get app.shutdown() called and data gets flushed:

...

async with app:
    await app.initialize()
    await app.process_update(
        Update.de_json(json.loads(event["body"]), application.bot)
    )

...

Would suggest enhance documentation and all examples with such usage.

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
6 replies
@Bibo-Joshi
Comment options

@ubertao
Comment options

@Bibo-Joshi
Comment options

@ubertao
Comment options

@Bibo-Joshi
Comment options

Comment options

You must be logged in to vote
1 reply
@Bibo-Joshi
Comment options

Answer selected by ubertao
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants