Skip to content

Avoid making a second network call from inside Lambda? #1095

Answered by MattReimer
MattReimer asked this question in Q&A
Discussion options

You must be logged in to vote

Ok. I think I figured it out. Here's my final pattern. I left out the qgis_to_titiler_colormap to keep the example short.

from typing import Annotated, Optional, Sequence, Tuple, Dict
import os
import logging
import time
import httpx
from fastapi import FastAPI, Depends
from mangum import Mangum
from rio_tiler.io import Reader
from titiler.core.factory import TilerFactory
from titiler.core.dependencies import ImageRenderingParams
from titiler.application.settings import ApiSettings
from titiler.core.errors import DEFAULT_STATUS_CODES, add_exception_handlers



BUCKET_NAME = os.environ.get("BUCKET_NAME", "DUMMY")
# Set this to False in an env file to disable caching for testing
USE_CACHE = os

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@MattReimer
Comment options

@MattReimer
Comment options

@MattReimer
Comment options

@MattReimer
Comment options

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