-
Notifications
You must be signed in to change notification settings - Fork 6
feat: upgrade API runtime dependencies #262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
f3a6161
chore: update stac-fastapi-pgstac runtime dependencies
hrodmn 9716304
chore: update ingestor-api dependencies
hrodmn 146e448
chore: update stac-auth-proxy runtime dependencies
hrodmn 4b5cf92
chore: update stac-loader runtime dependencies
hrodmn 6716066
chore: update stactools-item-generator runtime dependencies
hrodmn 82dbaa5
chore: update tipg runtime dependencies
hrodmn 98a70cc
chore(deps): upgrade titiler-pgstac runtime dependencies
hrodmn 1cd4c5e
fix: update handlers for new versions of fastapi/starlette
hrodmn 58aa092
chore: fix formatting
hrodmn 12892eb
ci: get logs from cloudwatch if there is an error
hrodmn 96ca9a7
fix: event loop handling in handlers
hrodmn 3f040d7
chore: upgrade to stac-auth-proxy 1.1.1
hrodmn 8585b0f
chore(deps): upgrade to mangum>=0.21
hrodmn 87a0e88
refactor: move some functions into shared utils.py, import in handlers
hrodmn 18b62a2
ci: add utils.py to path for stac-loader tests
hrodmn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,32 @@ | ||
| """ | ||
| Entrypoint for Lambda execution. | ||
| """ | ||
| """Entrypoint for Lambda execution.""" | ||
|
|
||
| import asyncio | ||
| from typing import Any | ||
|
|
||
| from mangum import Mangum | ||
|
|
||
| from .main import app | ||
|
|
||
| handler = Mangum(app, lifespan="off", api_gateway_base_path=app.root_path) | ||
|
|
||
| def _ensure_event_loop() -> asyncio.AbstractEventLoop: | ||
| """Return the current event loop, creating and installing one if needed.""" | ||
| try: | ||
| return asyncio.get_running_loop() | ||
| except RuntimeError: | ||
| pass | ||
|
|
||
| try: | ||
| return asyncio.get_event_loop() | ||
| except RuntimeError: | ||
| loop = asyncio.new_event_loop() | ||
| asyncio.set_event_loop(loop) | ||
| return loop | ||
|
gadomski marked this conversation as resolved.
|
||
|
|
||
|
|
||
| _asgi_handler = Mangum(app, lifespan="off", api_gateway_base_path=app.root_path) | ||
|
|
||
|
|
||
| def handler(event: Any, context: Any) -> dict[str, Any]: | ||
| """Handle AWS Lambda events with a guaranteed current event loop.""" | ||
| _ensure_event_loop() | ||
| return _asgi_handler(event, context) | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.